Skip to content

Commit 5871720

Browse files
authored
Merge pull request #53 from utgwkk/change-ci-python-version
Add Python 3.10 and pytest 7 to CI
2 parents dcf346b + 585c318 commit 5871720

File tree

2 files changed

+33
-22
lines changed

2 files changed

+33
-22
lines changed

.github/workflows/test.yml

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,11 @@ jobs:
1818
- '3.7'
1919
- '3.8'
2020
- '3.9'
21-
pytest-version:
22-
- 4
23-
- 5
24-
- 6
25-
exclude:
26-
# pytest >= 5.x.x doesn't support Python 2.7
27-
- os: ubuntu-latest
28-
python-version: 2.7
29-
pytest-version: 5
30-
- os: ubuntu-latest
31-
python-version: 2.7
32-
pytest-version: 6
33-
- os: windows-latest
34-
python-version: 2.7
35-
pytest-version: 5
36-
- os: windows-latest
37-
python-version: 2.7
38-
pytest-version: 6
21+
- '3.10'
3922

4023
runs-on: ${{ matrix.os }}
4124

42-
name: ${{ matrix.os }}, Python ${{ matrix.python-version }}, pytest ${{ matrix.pytest-version }}
25+
name: ${{ matrix.os }}, Python ${{ matrix.python-version }}
4326
steps:
4427
- uses: actions/checkout@v3
4528

@@ -53,11 +36,36 @@ jobs:
5336
python -m pip install --upgrade pip
5437
pip install tox tox-gh-actions
5538
56-
- name: Run test
39+
- name: Run tests with PyTest 4
5740
run: tox
41+
if: ${{ matrix.python-version != '3.10' }}
5842
env:
5943
PLATFORM: ${{ matrix.os }}
60-
PYTEST_MAJOR_VERSION: ${{ matrix.pytest-version }}
44+
PYTEST_MAJOR_VERSION: 4
45+
PYTEST_PLUGINS: pytest_github_actions_annotate_failures
46+
47+
- name: Run tests with PyTest 5
48+
run: tox
49+
if: ${{ matrix.python-version != '2.7' && matrix.python-version != '3.10' }}
50+
env:
51+
PLATFORM: ${{ matrix.os }}
52+
PYTEST_MAJOR_VERSION: 5
53+
PYTEST_PLUGINS: pytest_github_actions_annotate_failures
54+
55+
- name: Run tests with PyTest 6
56+
run: tox
57+
if: ${{ matrix.python-version != '2.7' }}
58+
env:
59+
PLATFORM: ${{ matrix.os }}
60+
PYTEST_MAJOR_VERSION: 6
61+
PYTEST_PLUGINS: pytest_github_actions_annotate_failures
62+
63+
- name: Run tests with PyTest 7
64+
run: tox
65+
if: ${{ matrix.python-version != '2.7' }}
66+
env:
67+
PLATFORM: ${{ matrix.os }}
68+
PYTEST_MAJOR_VERSION: 7
6169
PYTEST_PLUGINS: pytest_github_actions_annotate_failures
6270

6371
post-test:

tox.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py27-pytest4-{linux,windows}, py{36,37,38,39}-pytest{4,5,6}-{linux,windows}
2+
envlist = py27-pytest4-{linux,windows}, py{36,37,38,39}-pytest{4,5,6,7}-{linux,windows}, py{310}-pytest{6,7}-{linux,windows}
33

44
[gh-actions]
55
python =
@@ -8,6 +8,7 @@ python =
88
3.7: py37
99
3.8: py38
1010
3.9: py39
11+
3.10: py310
1112

1213
[gh-actions:env]
1314
PLATFORM =
@@ -18,12 +19,14 @@ PYTEST_MAJOR_VERSION =
1819
4: pytest4
1920
5: pytest5
2021
6: pytest6
22+
7: pytest7
2123

2224
[testenv]
2325
deps =
2426
-rrequirements.txt
2527
pytest4: pytest>=4.0.0,<5.0.0
2628
pytest5: pytest>=5.0.0,<6.0.0
2729
pytest6: pytest>=6.0.0,<7.0.0
30+
pytest7: pytest>=7.0.0,<8.0.0
2831

2932
commands = {envpython} -m pytest

0 commit comments

Comments
 (0)