Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
469c8c50d0 | ||
|
|
79f1b6dab2 | ||
|
|
75e61d86b7 | ||
|
|
20a1b9ef11 | ||
|
|
a54f531701 | ||
|
|
4389843dcb |
@@ -1,3 +1,14 @@
|
|||||||
|
pytest-xdist 1.19.1 (2017-08-10)
|
||||||
|
================================
|
||||||
|
|
||||||
|
Bug Fixes
|
||||||
|
---------
|
||||||
|
|
||||||
|
- Fix crash when transferring internal pytest warnings from workers to the
|
||||||
|
master node. (`#214 <https://github.com/pytest-dev/pytest-
|
||||||
|
xdist/issues/214>`_)
|
||||||
|
|
||||||
|
|
||||||
pytest-xdist 1.19.0 (2017-08-09)
|
pytest-xdist 1.19.0 (2017-08-09)
|
||||||
================================
|
================================
|
||||||
|
|
||||||
|
|||||||
@@ -340,18 +340,28 @@ class TestTerminalReporting:
|
|||||||
])
|
])
|
||||||
|
|
||||||
@pytest.mark.parametrize('n', ['-n0', '-n1'])
|
@pytest.mark.parametrize('n', ['-n0', '-n1'])
|
||||||
def test_logwarning(self, testdir, n):
|
@pytest.mark.parametrize('warn_type', ['pytest', 'builtin'])
|
||||||
|
def test_logwarning(self, testdir, n, warn_type):
|
||||||
from pkg_resources import parse_version
|
from pkg_resources import parse_version
|
||||||
if parse_version(pytest.__version__) < parse_version('3.1'):
|
if parse_version(pytest.__version__) < parse_version('3.1'):
|
||||||
pytest.skip('pytest warnings requires >= 3.1')
|
pytest.skip('pytest warnings requires >= 3.1')
|
||||||
|
|
||||||
|
if warn_type == 'builtin':
|
||||||
|
warn_code = """warnings.warn(UserWarning('this is a warning'))"""
|
||||||
|
elif warn_type == 'pytest':
|
||||||
|
warn_code = """request.config.warn('', 'this is a warning',
|
||||||
|
fslocation=py.path.local())"""
|
||||||
|
else:
|
||||||
|
assert False
|
||||||
testdir.makepyfile("""
|
testdir.makepyfile("""
|
||||||
import warnings
|
import warnings, py
|
||||||
def test_func():
|
def test_func(request):
|
||||||
warnings.warn('this is a warning')
|
{warn_code}
|
||||||
""")
|
""".format(warn_code=warn_code))
|
||||||
result = testdir.runpytest(n)
|
result = testdir.runpytest(n)
|
||||||
result.stdout.fnmatch_lines([
|
result.stdout.fnmatch_lines([
|
||||||
"*this is a warning*",
|
"*this is a warning*",
|
||||||
|
"*1 passed, 1 warnings*",
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class SlaveInteractor:
|
|||||||
|
|
||||||
def pytest_logwarning(self, message, code, nodeid, fslocation):
|
def pytest_logwarning(self, message, code, nodeid, fslocation):
|
||||||
self.sendevent("logwarning", message=message, code=code, nodeid=nodeid,
|
self.sendevent("logwarning", message=message, code=code, nodeid=nodeid,
|
||||||
fslocation=fslocation)
|
fslocation=str(fslocation))
|
||||||
|
|
||||||
|
|
||||||
def serialize_report(rep):
|
def serialize_report(rep):
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ def unserialize_report(name, reportdict):
|
|||||||
ReprTraceback
|
ReprTraceback
|
||||||
)
|
)
|
||||||
if reportdict['longrepr']:
|
if reportdict['longrepr']:
|
||||||
if 'reprcrash' and 'reprtraceback' in reportdict['longrepr']:
|
if 'reprcrash' in reportdict['longrepr'] and 'reprtraceback' in reportdict['longrepr']:
|
||||||
|
|
||||||
reprtraceback = reportdict['longrepr']['reprtraceback']
|
reprtraceback = reportdict['longrepr']['reprtraceback']
|
||||||
reprcrash = reportdict['longrepr']['reprcrash']
|
reprcrash = reportdict['longrepr']['reprcrash']
|
||||||
|
|||||||
Reference in New Issue
Block a user