From 13a6727ec613ff0f748d832b4d239cf8adc63b58 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Wed, 31 Jan 2024 15:09:08 -0800 Subject: [PATCH] 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 --- .github/workflows/pr-check.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 62dff5c876b3..5ec7027c74e5 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -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 @@ -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: