diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..62c8418 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,6 @@ +[run] +branch = true +source = + kosmorrolib +omit = + tests/* diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 4fc38e4..424be74 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -35,12 +35,8 @@ jobs: pipenv lock --pre pipenv sync --dev - name: Unit tests - env: - COVERALLS_PRO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - make test - pipenv run coveralls --service=github + make legacy-tests unit-tests: runs-on: ${{ matrix.os }} @@ -74,5 +70,5 @@ jobs: COVERALLS_PRO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - make test + make doctests pipenv run coveralls --service=github diff --git a/Makefile b/Makefile index 8654a81..dfc4112 100644 --- a/Makefile +++ b/Makefile @@ -2,14 +2,16 @@ black: pipenv run black kosmorrolib tests .PHONY: test -tests: legacy-tests - python3 tests.py +tests: legacy-tests doctests + +doctests: + pipenv run python3 -m coverage run tests.py legacy-tests: unset KOSMORRO_LATITUDE; \ unset KOSMORRO_LONGITUDE; \ unset KOSMORRO_TIMEZONE; \ - LANG=C pipenv run python3 -m coverage run -m unittest tests + pipenv run python3 -m coverage run -m unittest tests .PHONY: build build: