Skip to content

Commit 4b1d9ac

Browse files
committed
Add tests with minimum supported Pytest version
I've edited the Github workflows configuration to run tests with the lowest version of pytest marked as supported. If anything in a future commit breaks compatibility with those versions, we'll be alerted by a test failure and we can adjust the version compatibility accordingly.
1 parent 6e46849 commit 4b1d9ac

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/tests.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ jobs:
1717
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
1818
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11.0-beta - 3.11', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9']
1919
extra: ['', '-smtp']
20+
# The forced pytest versions correspond with the lower bounds in tox.ini
21+
pytest-version: ['', '--force-dep pytest==4', '--force-dep pytest==6.2.4']
22+
exclude:
23+
- python-version: '3.5'
24+
pytest-version: '--force-dep pytest==6.2.4'
25+
- python-version: '3.10'
26+
pytest-version: '--force-dep pytest==4'
27+
- python-version: '3.11.0-beta - 3.11'
28+
pytest-version: '--force-dep pytest==4'
2029
fail-fast: false
2130

2231
steps:
@@ -30,4 +39,4 @@ jobs:
3039
python -m pip install --upgrade pip
3140
pip install tox
3241
- name: Test with tox
33-
run: tox -vv -e py${{ matrix.extra }}
42+
run: tox -vv -e py${{ matrix.extra }} ${{ matrix.pytest-version }}

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ deps =
1919
# tox's --force-dep option to find the earliest versions of pytest that are
2020
# known to work. If you add code that breaks with an old version of pytest,
2121
# feel free to raise these bounds to represent the earliest version that
22-
# works with your code.
22+
# works with your code. Don't forget to modify the corresponding entries in
23+
# the Github workflows configuration file if you do change these lower
24+
# bounds.
2325
pytest >=4, <8; python_version<'3.10'
2426
pytest >=6.2.4, <8; python_version>='3.10'
2527
pytest-cov

0 commit comments

Comments
 (0)