Skip to content

Commit 7e1ec1f

Browse files
authored
Merge pull request #39 from utgwkk/tox
Test with tox
2 parents 1776d9e + 13456f8 commit 7e1ec1f

File tree

3 files changed

+43
-15
lines changed

3 files changed

+43
-15
lines changed

.github/workflows/test.yml

+13-15
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,23 @@ jobs:
1919
- '3.8'
2020
- '3.9'
2121
pytest-version:
22-
- 4.6.11
23-
- 5.4.3
24-
- 6.2.4
25-
22+
- 4
23+
- 5
24+
- 6
2625
exclude:
2726
# pytest >= 5.x.x doesn't support Python 2.7
2827
- os: ubuntu-latest
2928
python-version: 2.7
30-
pytest-version: 5.4.3
29+
pytest-version: 5
3130
- os: ubuntu-latest
3231
python-version: 2.7
33-
pytest-version: 6.2.4
32+
pytest-version: 6
3433
- os: windows-latest
3534
python-version: 2.7
36-
pytest-version: 5.4.3
35+
pytest-version: 5
3736
- os: windows-latest
3837
python-version: 2.7
39-
pytest-version: 6.2.4
38+
pytest-version: 6
4039

4140
runs-on: ${{ matrix.os }}
4241

@@ -49,17 +48,16 @@ jobs:
4948
with:
5049
python-version: ${{ matrix.python-version }}
5150

52-
- name: Install dependencies
51+
- name: Install test dependencies
5352
run: |
5453
python -m pip install --upgrade pip
55-
pip install -r requirements.txt
56-
pip install pytest==${{ matrix.pytest-version }}
57-
58-
- name: Install itself
59-
run: python setup.py install
54+
pip install tox tox-gh-actions
6055
61-
- run: pytest
56+
- name: Run test
57+
run: tox
6258
env:
59+
PLATFORM: ${{ matrix.os }}
60+
PYTEST_MAJOR_VERSION: ${{ matrix.pytest-version }}
6361
PYTEST_PLUGINS: pytest_github_actions_annotate_failures
6462

6563
post-test:

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
include *.py
22
include LICENSE
33
include CHANGELOG.md
4+
include tox.ini

tox.ini

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[tox]
2+
envlist = py27-pytest4-{linux,windows}, py{36,37,38,39}-pytest{4,5,6}-{linux,windows}
3+
4+
[gh-actions]
5+
python =
6+
2.7: py27
7+
3.6: py36
8+
3.7: py37
9+
3.8: py38
10+
3.9: py39
11+
12+
[gh-actions:env]
13+
PLATFORM =
14+
ubuntu-latest: linux
15+
windows-latest: windows
16+
17+
PYTEST_MAJOR_VERSION =
18+
4: pytest4
19+
5: pytest5
20+
6: pytest6
21+
22+
[testenv]
23+
deps =
24+
-rrequirements.txt
25+
pytest4: pytest>=4.0.0,<5.0.0
26+
pytest5: pytest>=5.0.0,<6.0.0
27+
pytest6: pytest>=6.0.0,<7.0.0
28+
29+
commands = {envpython} -m pytest

0 commit comments

Comments
 (0)