Skip to content

Commit 3ecdad6

Browse files
committed
terminal: improve condition on whether to display testpaths in header
Make it match better the condition on whether testpaths is used (found in config/__init__.py).
1 parent 61f80a7 commit 3ecdad6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_pytest/terminal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ def pytest_report_header(self, config: Config) -> List[str]:
719719
line += ", configfile: " + bestrelpath(config.rootpath, config.inipath)
720720

721721
testpaths = config.getini("testpaths") # type: List[str]
722-
if testpaths and config.args == testpaths:
722+
if config.invocation_params.dir == config.rootpath and config.args == testpaths:
723723
line += ", testpaths: {}".format(", ".join(testpaths))
724724

725725
result = [line]

0 commit comments

Comments
 (0)