Skip to content

Commit 13a6727

Browse files
include multiple pytest versions in PR check (#22813)
update PR check workflow to include testing Python tests against 3 versions of pytest: pre-release, stable release, and oldest supported version. --------- Co-authored-by: Karthik Nadig <[email protected]>
1 parent 6e8c56c commit 13a6727

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/pr-check.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ jobs:
9494
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the Unix case.
9595
os: [ubuntu-latest, windows-latest]
9696
# Run the tests on the oldest and most recent versions of Python.
97-
python: ['3.8', '3.x', '3.12-dev']
97+
python: ['3.8', '3.x'] # run for 3 pytest versions, most recent stable, oldest version supported and pre-release
98+
pytest-version: ['pytest', 'pytest@pre-release', 'pytest==6.2.0']
9899

99100
steps:
100101
- name: Checkout
@@ -107,6 +108,18 @@ jobs:
107108
with:
108109
python-version: ${{ matrix.python }}
109110

111+
- name: Install specific pytest version
112+
if: matrix.pytest-version == 'pytest@pre-release'
113+
run: |
114+
python -m pip install --pre pytest
115+
116+
- name: Install specific pytest version
117+
if: matrix.pytest-version != 'pytest@pre-release'
118+
run: |
119+
python -m pip install "${{ matrix.pytest-version }}"
120+
121+
- name: Install specific pytest version
122+
run: python -m pytest --version
110123
- name: Install base Python requirements
111124
uses: brettcannon/pip-secure-install@v1
112125
with:

0 commit comments

Comments
 (0)