diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 4b173353..bf778a1b 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -51,7 +51,20 @@ jobs: shell: bash -l {0} run: | micromamba activate torchquad - cd torchquad/tests + cd torchquad/tests/ pip install pytest pip install pytest-error-for-skips - pytest -ra --error-for-skips + pip install pytest-cov + pytest -ra --error-for-skips --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=../../torchquad . | tee pytest-coverage.txt + - name: pytest coverage comment + uses: MishaKav/pytest-coverage-comment@main + with: + pytest-coverage-path: ./torchquad/tests/pytest-coverage.txt + title: Coverage Report + badge-title: Overall Coverage + hide-badge: false + hide-report: false + create-new-comment: false + hide-comment: false + report-only-changed-files: false + junitxml-path: ./torchquad/tests/pytest.xml diff --git a/.gitignore b/.gitignore index dcfc7fa2..035839d8 100644 --- a/.gitignore +++ b/.gitignore @@ -129,4 +129,6 @@ dmypy.json .pyre/ my_notebooks -.vscode \ No newline at end of file +.vscode +pytest-coverage.txt +pytest.xml diff --git a/torchquad/tests/boole_test.py b/torchquad/tests/boole_test.py index 4e42f3ca..beeeace3 100644 --- a/torchquad/tests/boole_test.py +++ b/torchquad/tests/boole_test.py @@ -13,7 +13,8 @@ def _run_boole_tests(backend, _precision): """Test the integrate function in integration.Boole for the given backend. - Note: For now the 10-D test is diabled due to lack of GPU memory on some computers.""" + Note: For now the 10-D test is diabled due to lack of GPU memory on some computers. + """ bl = Boole() # 1D Tests diff --git a/torchquad/utils/set_up_backend.py b/torchquad/utils/set_up_backend.py index ec77c9d1..8d88bfff 100644 --- a/torchquad/utils/set_up_backend.py +++ b/torchquad/utils/set_up_backend.py @@ -7,7 +7,8 @@ def _get_default_backend(): """Get the latest backend which was passed to set_up_backend. - If set_up_backend has never been executed, return "torch" for backwards compatibility""" + If set_up_backend has never been executed, return "torch" for backwards compatibility + """ return os.environ.get("TORCHQUAD_DEFAULT_BACKEND", "torch")