Fix load scope tests in pytest 3.3

Fix #260
This commit is contained in:
Bruno Oliveira
2017-12-22 15:35:08 -02:00
parent ed9f25a0d2
commit 28d60f94f3

View File

@@ -860,7 +860,13 @@ def parse_tests_and_workers_from_output(lines):
result = [] result = []
for line in lines: for line in lines:
# example match: "[gw0] PASSED test_a.py::test[7]" # 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: if m:
worker, status, nodeid = m.groups() worker, status, nodeid = m.groups()
result.append((worker, status, nodeid)) result.append((worker, status, nodeid))