Merge pull request #261 from nicoddemus/pytest33

Fix tests in pytest >= 3.3 and add it to build matrix
This commit is contained in:
Ronny Pfannschmidt
2017-12-22 18:51:02 +01:00
committed by GitHub
4 changed files with 17 additions and 9 deletions

View File

@@ -20,6 +20,7 @@ env:
- TOXENV=py-pytest30
- TOXENV=py-pytest31
- TOXENV=py-pytest32
- TOXENV=py-pytest33
install: pip install tox setuptools_scm
script: tox

View File

@@ -1,12 +1,12 @@
environment:
matrix:
# note: please use "tox --listenvs" to populate the build matrix
- TOXENV: "py27-pytest30"
- TOXENV: "py34-pytest30"
- TOXENV: "py35-pytest30"
- TOXENV: "py36-pytest30"
- TOXENV: "py27-pytest30-pexpect"
- TOXENV: "py35-pytest30-pexpect"
- TOXENV: "py27-pytest33"
- TOXENV: "py34-pytest33"
- TOXENV: "py35-pytest33"
- TOXENV: "py36-pytest33"
- TOXENV: "py27-pytest33-pexpect"
- TOXENV: "py36-pytest33-pexpect"
- TOXENV: "flakes"
- TOXENV: "readme"

View File

@@ -860,7 +860,13 @@ def parse_tests_and_workers_from_output(lines):
result = []
for line in lines:
# example match: "[gw0] PASSED test_a.py::test[7]"
m = re.match(r'\[(gw\d)\]\s(.*?)\s(.*::.*)', line.strip())
m = re.match(r'''
\[(gw\d)\] # worker
\s*
(?:\[\s*\d+%\])? # progress indicator (pytest >=3.3)
\s(.*?) # status string ("PASSED")
\s(.*::.*) # nodeid
''', line.strip(), re.VERBOSE)
if m:
worker, status, nodeid = m.groups()
result.append((worker, status, nodeid))

View File

@@ -1,8 +1,8 @@
[tox]
# if you change the envlist, please update .travis.yml file as well
envlist=
py{27,34,35,36}-pytest{30,31,32}
py{27,36}-pytest{30,31,32}-pexpect
py{27,34,35,36}-pytest{30,31,32,33}
py{27,36}-pytest{30,31,32,33}-pexpect
py{27,36}-pytest{master,features}
flakes
readme
@@ -18,6 +18,7 @@ deps =
pytest30: pytest~=3.0.5
pytest31: pytest~=3.1.0
pytest32: pytest~=3.2.0
pytest33: pytest~=3.3.0
pytestmaster: git+https://github.com/pytest-dev/pytest.git@master
pytestfeatures: git+https://github.com/pytest-dev/pytest.git@features
pexpect: pexpect