Skip to content

Commit c44d10b

Browse files
authored
Reorder pr-check.yml so specific pytest version installs after test-requirements
1 parent e414347 commit c44d10b

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

.github/workflows/pr-check.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,6 @@ jobs:
172172
with:
173173
python-version: ${{ matrix.python }}
174174

175-
- name: Install specific pytest version
176-
if: matrix.pytest-version == 'pytest@pre-release'
177-
run: |
178-
python -m pip install --pre pytest
179-
180-
- name: Install specific pytest version
181-
if: matrix.pytest-version != 'pytest@pre-release'
182-
run: |
183-
python -m pip install "${{ matrix.pytest-version }}"
184-
185-
- name: Install specific pytest version
186-
run: python -m pytest --version
187175
- name: Install base Python requirements
188176
uses: brettcannon/pip-secure-install@92f400e3191171c1858cc0e0d9ac6320173fdb0c # v1.0.0
189177
with:
@@ -193,6 +181,19 @@ jobs:
193181
- name: Install test requirements
194182
run: python -m pip install --upgrade -r build/test-requirements.txt
195183

184+
# Install the specific pytest version AFTER test-requirements.txt so it is not
185+
# overridden by the `pytest<8.1` pin (needed for pytest-black compatibility).
186+
- name: Install specific pytest version (pre-release)
187+
if: matrix.pytest-version == 'pytest@pre-release'
188+
run: python -m pip install --upgrade --pre pytest
189+
190+
- name: Install specific pytest version
191+
if: matrix.pytest-version != 'pytest@pre-release'
192+
run: python -m pip install --upgrade "${{ matrix.pytest-version }}"
193+
194+
- name: Print pytest version
195+
run: python -m pytest --version
196+
196197
- name: Run Python unit tests
197198
run: python python_files/tests/run_all.py
198199

0 commit comments

Comments
 (0)