From 225cf748e902f4bcae755c28596b609aed78a951 Mon Sep 17 00:00:00 2001 From: David Hoese <david.hoese@ssec.wisc.edu> Date: Fri, 3 Jul 2020 16:16:45 -0500 Subject: [PATCH] Fix coverage usage in CI --- .gitignore | 6 ++++++ .gitlab-ci.yml | 2 +- test.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7f5c15e --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +hello +.coverage +*.pyc +.pytest_cache/ +*.[oa] +*~ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc5f5b4..16e0c67 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,7 +49,7 @@ tests: - ssec_shared script: - pip install pytest pytest-cov - - pytest . + - pytest --cov=. test.py coverage: '/TOTAL.*\s+(\d+%)$/' needs: - job: build_hello_world diff --git a/test.py b/test.py index 37b359d..704353e 100644 --- a/test.py +++ b/test.py @@ -5,7 +5,7 @@ def test_hello_world_c(): import subprocess bytes_out = subprocess.check_output(['./hello']) - assert bytes_out == b'Hello World!\n' + assert bytes_out == b'Hello, World!\n' def test_hello_world_py(): -- GitLab