diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..b411f9d --- /dev/null +++ b/.coveragerc @@ -0,0 +1,24 @@ +[run] +source = + SOURCES/ + tests/ + +[report] +# Regexes for lines to exclude from consideration +exclude_lines = + # Have to re-enable the standard pragma + pragma: no cover + + # Don't complain if tests don't hit defensive assertion code: + raise AssertionError + raise NotImplementedError + \.* + + # Don't complain if non-runnable code isn't run: + if 0: + if __name__ == .__main__.: + +precision = 1 +include = + SOURCES/* + tests/* diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fffa84b..8a1ef1a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,9 +12,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install mock pytest pyfakefs + pip install pathlib mock pytest pytest-cov pyfakefs if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: pytest run: | - cd tests - pytest + pytest --cov --cov-report=xml --cov-report=term tests diff --git a/.gitignore b/.gitignore index eeb8a6e..0b837b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ **/__pycache__ +*.pyc +/.coverage +/coverage.xml