Skip to content

Commit

Permalink
include multiple pytest versions in PR check (#22813)
Browse files Browse the repository at this point in the history
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 <kanadig@microsoft.com>
  • Loading branch information
eleanorjboyd and karthiknadig committed Jan 31, 2024
1 parent 6e8c56c commit 13a6727
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ jobs:
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the Unix case.
os: [ubuntu-latest, windows-latest]
# Run the tests on the oldest and most recent versions of Python.
python: ['3.8', '3.x', '3.12-dev']
python: ['3.8', '3.x'] # run for 3 pytest versions, most recent stable, oldest version supported and pre-release
pytest-version: ['pytest', 'pytest@pre-release', 'pytest==6.2.0']

steps:
- name: Checkout
Expand All @@ -107,6 +108,18 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Install specific pytest version
if: matrix.pytest-version == 'pytest@pre-release'
run: |
python -m pip install --pre pytest
- name: Install specific pytest version
if: matrix.pytest-version != 'pytest@pre-release'
run: |
python -m pip install "${{ matrix.pytest-version }}"
- name: Install specific pytest version
run: python -m pytest --version
- name: Install base Python requirements
uses: brettcannon/pip-secure-install@v1
with:
Expand Down

0 comments on commit 13a6727

Please sign in to comment.