improved reporting
added intermediate level of quiet reporting: * -q now shows short summary (# passed/failed tests + time) * the former -q is now -qq
This commit is contained in:
parent
ab637e028b
commit
87df85f12d
|
@ -462,6 +462,10 @@ class TerminalReporter:
|
|||
else:
|
||||
markup['green'] = True
|
||||
self.write_sep("=", msg, **markup)
|
||||
if self.verbosity == -1:
|
||||
if line:
|
||||
self.write("%s, " % line)
|
||||
self.write("time: %.2f seconds\n" % session_duration)
|
||||
#else:
|
||||
# self.write_line(msg, bold=True)
|
||||
|
||||
|
|
|
@ -473,6 +473,17 @@ class TestTerminalFunctional:
|
|||
assert 'test session starts' not in s
|
||||
assert p1.basename not in s
|
||||
assert "===" not in s
|
||||
assert "passed" in s
|
||||
|
||||
def test_more_quiet_reporting(self, testdir):
|
||||
p1 = testdir.makepyfile("def test_pass(): pass")
|
||||
result = testdir.runpytest(p1, '-qq')
|
||||
s = result.stdout.str()
|
||||
assert 'test session starts' not in s
|
||||
assert p1.basename not in s
|
||||
assert "===" not in s
|
||||
assert "passed" not in s
|
||||
|
||||
|
||||
def test_fail_extra_reporting(testdir):
|
||||
p = testdir.makepyfile("def test_this(): assert 0")
|
||||
|
|
Loading…
Reference in New Issue