File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,18 +11,22 @@ jobs:
1111 strategy :
1212 fail-fast : false
1313 matrix :
14+ python-version : ["pypy-3.7", "3.9"]
1415 target : [
1516 " src-layout" ,
1617 " adhoc-layout" ,
1718 ]
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"}
1923 steps :
2024 - uses : actions/checkout@v2
2125
22- - name : Set up Python
26+ - name : Set up Python ${{ matrix.python-version }}
2327 uses : actions/setup-python@v2
2428 with :
25- python-version : 3.9
29+ python-version : ${{ matrix.python-version }}
2630
2731 - name : Cache
2832 uses : actions/cache@v2
4246 - name : Examples
4347 run : |
4448 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 11[tox]
2- envlist = py38 ,report
2+ envlist = pypy3,py39 ,report
33
44[tool:pytest]
55addopts =
66 --cov-report =term-missing
77
88[testenv]
99setenv =
10- py38 : COVERAGE_FILE = .coverage.{envname}
10+ py{py3,39} : COVERAGE_FILE = .coverage.{envname}
1111commands = pytest --cov --cov-config ={toxinidir}/.coveragerc {posargs:-vv}
1212deps =
1313 pytest
1919 ../..
2020
2121depends =
22- report: py38
22+ report: pypy3,py39
2323
2424# note that this is necessary to prevent the tests importing the code from your badly laid project
2525changedir = 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 11[tox]
2- envlist = py38 ,report
2+ envlist = pypy3,py39 ,report
33
44[tool:pytest]
55testpaths = tests
@@ -8,7 +8,7 @@ addopts =
88
99[testenv]
1010setenv =
11- py38 : COVERAGE_FILE = .coverage.{envname}
11+ py{py3,39} : COVERAGE_FILE = .coverage.{envname}
1212commands = pytest --cov {posargs:-vv}
1313deps =
1414 pytest
2020 ../..
2121
2222depends =
23- report: py38
23+ report: pypy3,py39
2424
2525[testenv:report]
2626skip_install = true
You can’t perform that action at this time.
0 commit comments