Skip to content

Commit

Permalink
Increase required verbosity level for debug output
Browse files Browse the repository at this point in the history
To show the subclassed file in legacy test suits in the runtest output
you have to set the verbosity level to at least "-vv" now.

Closes #3211
  • Loading branch information
twmr committed Oct 15, 2018
1 parent 58b6e86 commit d4a6c54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/_pytest/terminal.py
Expand Up @@ -676,7 +676,9 @@ def mkrel(nodeid):

if fspath:
res = mkrel(nodeid).replace("::()", "") # parens-normalization
if nodeid.split("::")[0] != fspath.replace("\\", nodes.SEP):
if self.verbosity >= 2 and nodeid.split("::")[0] != fspath.replace(
"\\", nodes.SEP
):
res += " <- " + self.startdir.bestrelpath(fspath)
else:
res = "[location]"
Expand Down
4 changes: 2 additions & 2 deletions testing/test_terminal.py
Expand Up @@ -154,7 +154,7 @@ class TestMore(BaseTests):
)
result = testdir.runpytest(p2)
result.stdout.fnmatch_lines(["*test_p2.py .*", "*1 passed*"])
result = testdir.runpytest("-v", p2)
result = testdir.runpytest("-vv", p2)
result.stdout.fnmatch_lines(
["*test_p2.py::TestMore::test_p1* <- *test_p1.py*PASSED*"]
)
Expand All @@ -170,7 +170,7 @@ def test_method(self):
"""
)
)
result = testdir.runpytest("-v")
result = testdir.runpytest("-vv")
assert result.ret == 0
result.stdout.fnmatch_lines(["*a123/test_hello123.py*PASS*"])
assert " <- " not in result.stdout.str()
Expand Down

0 comments on commit d4a6c54

Please sign in to comment.