From 9de2e665fd972b2e05fe5751d949eec2b657bf40 Mon Sep 17 00:00:00 2001 From: mrbean-bremen Date: Wed, 11 Dec 2024 10:43:13 +0100 Subject: [PATCH] Run pytest-specific tests for all Python versions - also use "pytest" instead of "python -m pytest" to catch errors specific to this call - support pytest only from version 6.2.5, earlier versions did not work for current Python versions --- .github/workflows/testsuite.yml | 21 +++++++++---------- CHANGES.md | 7 ++++++- README.md | 2 +- .../pytest_module_fixture_test.py | 2 +- requirements.txt | 2 +- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 3240fe2a..0fbdec73 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -113,8 +113,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - python-version: ["3.9"] - pytest-version: [3.0.0, 3.5.1, 4.0.2, 4.5.0, 5.0.1, 5.4.3, 6.0.2, 6.2.5, 7.0.1, 7.4.4, 8.0.2, 8.1.2, 8.2.0] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13"] + pytest-version: [6.2.5, 7.0.1, 7.4.4, 8.0.2, 8.3.4] + exclude: + # some tests still fail for macOS/Python 3.13 + - python-version: "3.13" + os: macOS-latest steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -126,20 +130,15 @@ jobs: python -m pip install --upgrade pip python -m pip install -r requirements.txt python -m pip install -U pytest==${{ matrix.pytest-version }} - python -m pip install opentimelineio pandas parquet pyarrow + python -m pip install pandas parquet pyarrow python -m pip install -e . - if [[ '${{ matrix.pytest-version }}' == '4.0.2' ]]; then - python -m pip install -U attrs==19.1.0 - fi shell: bash - name: Run pytest tests run: | echo "$(python -m pytest pyfakefs/pytest_tests/pytest_plugin_failing_helper.py)" > ./testresult.txt - python -m pytest pyfakefs/pytest_tests - if [[ '${{ matrix.pytest-version }}' > '3.0.0' ]]; then - cd pyfakefs/pytest_tests/ns_package - python -m pytest --log-cli-level=INFO test - fi + pytest pyfakefs/pytest_tests + cd pyfakefs/pytest_tests/ns_package + pytest --log-cli-level=INFO test shell: bash dependency-check: diff --git a/CHANGES.md b/CHANGES.md index 18673032..5f0b41d8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,7 +16,12 @@ The released versions correspond to PyPI releases. ### Fixes * fixed a regression in version 5.7.2 that `tempfile` was not patched after pause/resume - (POSIX only, see [#1098](../../issues/1098)) + (POSIX only, see [#1098](../../issues/1098))4 + +### Infrastructure +* run pytest-specific tests for all supported Python versions +* pytest is only supported for versions >= 6.2.5, earlier version do not work + due to a pytest issue - adapted tests and documentation ## [Version 5.7.2](https://pypi.python.org/pypi/pyfakefs/5.7.2) (2024-12-01) Fixes some problems with patching. diff --git a/README.md b/README.md index 9181a938..77867f44 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ provides some additional features: pyfakefs works with CPython 3.7 and above, on Linux, Windows and macOS, and with PyPy3. -pyfakefs works with [pytest](http://doc.pytest.org) version 3.0.0 or above, +pyfakefs works with [pytest](http://doc.pytest.org) version 6.2.5 or above, though a current version is recommended. pyfakefs will not work with Python libraries that use C libraries to access the diff --git a/pyfakefs/pytest_tests/pytest_module_fixture_test.py b/pyfakefs/pytest_tests/pytest_module_fixture_test.py index 3aa9bcb5..e7d30a49 100644 --- a/pyfakefs/pytest_tests/pytest_module_fixture_test.py +++ b/pyfakefs/pytest_tests/pytest_module_fixture_test.py @@ -27,5 +27,5 @@ def test_fs_uses_fs_module1(): def test_fs_uses_fs_module2(fs): - # check that testing was not stopped by the first test + # check that patching was not stopped by the first test assert os.path.exists(os.path.join("foo", "bar")) diff --git a/requirements.txt b/requirements.txt index b9494825..c63164ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -pytest>=3.0.0 +pytest>=6.2.5