fix a bug that collectonly reporting did not show internal errors (thanks ronny)
--HG-- branch : trunk
This commit is contained in:
parent
3bdcd2f793
commit
78bae2dd04
|
@ -349,6 +349,10 @@ class CollectonlyReporter:
|
|||
def outindent(self, line):
|
||||
self.out.line(self.indent + str(line))
|
||||
|
||||
def pytest_internalerror(self, excrepr):
|
||||
for line in str(excrepr).split("\n"):
|
||||
self.out.line("INTERNALERROR> " + line)
|
||||
|
||||
def pytest_collectstart(self, collector):
|
||||
self.outindent(collector)
|
||||
self.indent += self.INDENT
|
||||
|
@ -740,6 +744,17 @@ class TestCollectonly:
|
|||
!!! ValueError: 0 !!!
|
||||
""")
|
||||
|
||||
def test_collectonly_fatal(self, testdir):
|
||||
p1 = testdir.makeconftest("""
|
||||
def pytest_collectstart(collector):
|
||||
assert 0, "urgs"
|
||||
""")
|
||||
result = testdir.runpytest("--collectonly")
|
||||
result.stdout.fnmatch_lines([
|
||||
"*INTERNAL*args*"
|
||||
])
|
||||
assert result.ret == 3
|
||||
|
||||
def test_repr_python_version(monkeypatch):
|
||||
monkeypatch.setattr(sys, 'version_info', (2, 5, 1, 'final', 0))
|
||||
assert repr_pythonversion() == "2.5.1-final-0"
|
||||
|
|
Loading…
Reference in New Issue