File tree 5 files changed +36
-14
lines changed
5 files changed +36
-14
lines changed Original file line number Diff line number Diff line change @@ -11,18 +11,22 @@ jobs:
11
11
strategy :
12
12
fail-fast : false
13
13
matrix :
14
+ python-version : ["pypy-3.7", "3.9"]
14
15
target : [
15
16
" src-layout" ,
16
17
" adhoc-layout" ,
17
18
]
18
-
19
+ include :
20
+ # Add new helper variables to existing jobs
21
+ - {python-version: "pypy-3.7", tox-python-version: "pypy3"}
22
+ - {python-version: "3.9", tox-python-version: "py39"}
19
23
steps :
20
24
- uses : actions/checkout@v2
21
25
22
- - name : Set up Python
26
+ - name : Set up Python ${{ matrix.python-version }}
23
27
uses : actions/setup-python@v2
24
28
with :
25
- python-version : 3.9
29
+ python-version : ${{ matrix.python-version }}
26
30
27
31
- name : Cache
28
32
uses : actions/cache@v2
42
46
- name : Examples
43
47
run : |
44
48
cd examples/${{ matrix.target }}
45
- tox -v
49
+ tox -v -e ${{ matrix.tox-python-version }}
Original file line number Diff line number Diff line change 1
- def add (a , b ):
2
- return a + b
1
+ import platform
2
+
3
+ # test merging multiple tox runs with a platform
4
+ # based branch
5
+ if platform .python_implementation () == "PyPy" :
6
+ def add (a , b ):
7
+ return a + b
8
+
9
+ else :
10
+ def add (a , b ):
11
+ return a + b
Original file line number Diff line number Diff line change 1
1
[tox]
2
- envlist = py38 ,report
2
+ envlist = pypy3,py39 ,report
3
3
4
4
[tool:pytest]
5
5
addopts =
6
6
--cov-report =term-missing
7
7
8
8
[testenv]
9
9
setenv =
10
- py38 : COVERAGE_FILE = .coverage.{envname}
10
+ py{py3,39} : COVERAGE_FILE = .coverage.{envname}
11
11
commands = pytest --cov --cov-config ={toxinidir}/.coveragerc {posargs:-vv}
12
12
deps =
13
13
pytest
19
19
../..
20
20
21
21
depends =
22
- report: py38
22
+ report: pypy3,py39
23
23
24
24
# note that this is necessary to prevent the tests importing the code from your badly laid project
25
25
changedir = tests
Original file line number Diff line number Diff line change 1
- def add (a , b ):
2
- return a + b
1
+ import platform
2
+
3
+ # test merging multiple tox runs with a platform
4
+ # based branch
5
+ if platform .python_implementation () == "PyPy" :
6
+ def add (a , b ):
7
+ return a + b
8
+
9
+ else :
10
+ def add (a , b ):
11
+ return a + b
Original file line number Diff line number Diff line change 1
1
[tox]
2
- envlist = py38 ,report
2
+ envlist = pypy3,py39 ,report
3
3
4
4
[tool:pytest]
5
5
testpaths = tests
@@ -8,7 +8,7 @@ addopts =
8
8
9
9
[testenv]
10
10
setenv =
11
- py38 : COVERAGE_FILE = .coverage.{envname}
11
+ py{py3,39} : COVERAGE_FILE = .coverage.{envname}
12
12
commands = pytest --cov {posargs:-vv}
13
13
deps =
14
14
pytest
20
20
../..
21
21
22
22
depends =
23
- report: py38
23
+ report: pypy3,py39
24
24
25
25
[testenv:report]
26
26
skip_install = true
You can’t perform that action at this time.
0 commit comments