diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index e6ed34bf..1ed50859 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -23,4 +23,9 @@ jobs: environment-file: .conda/benchcab-dev.yaml - name: Test with pytest run: | - TMPDIR=${{ runner.temp }} pytest \ No newline at end of file + coverage run -m pytest + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + files: ./.coverage \ No newline at end of file diff --git a/tests/common.py b/tests/common.py index 01952f49..9e0385ef 100644 --- a/tests/common.py +++ b/tests/common.py @@ -1,9 +1,9 @@ """Helper functions for `pytest`.""" -import os +import tempfile from pathlib import Path -TMP_DIR = Path(os.environ["TMPDIR"], "benchcab_tests") +TMP_DIR = Path(tempfile.mkdtemp(prefix="benchcab_tests")) def make_barebones_config() -> dict: