Skip to content

Commit

Permalink
Run pytest-specific tests for all Python versions
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
mrbean-bremen committed Dec 11, 2024
1 parent b05ca15 commit 9de2e66
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyfakefs/pytest_tests/pytest_module_fixture_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pytest>=3.0.0
pytest>=6.2.5

0 comments on commit 9de2e66

Please sign in to comment.