summaryrefslogtreecommitdiff
path: root/src/_pytest/terminal.py
diff options
context:
space:
mode:
authorRan Benita <ran@unusedvar.com>2020-10-03 12:59:18 +0300
committerGitHub <noreply@github.com>2020-10-03 12:59:18 +0300
commita6a7ba57e0867e643817d5f3219126d72f419c30 (patch)
treebc616ebcd0fbcb9f9c142f902c96b06b085c88d5 /src/_pytest/terminal.py
parenta23666d55494f6960dfc8845757c391b5aedec0b (diff)
parent3ecdad67b769c963fe08a7da41650d4a6262935c (diff)
downloadpytest-a6a7ba57e0867e643817d5f3219126d72f419c30.tar.gz
Merge pull request #7817 from bluetech/fix-testpaths-bestrelpath2
terminal: fix crash in header reporting when absolute testpaths is used
Diffstat (limited to 'src/_pytest/terminal.py')
-rw-r--r--src/_pytest/terminal.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py
index 727c15cb8..21634cbbc 100644
--- a/src/_pytest/terminal.py
+++ b/src/_pytest/terminal.py
@@ -718,10 +718,10 @@ class TerminalReporter:
if config.inipath:
line += ", configfile: " + bestrelpath(config.rootpath, config.inipath)
- testpaths = config.getini("testpaths")
- if testpaths and config.args == testpaths:
- rel_paths = [bestrelpath(config.rootpath, x) for x in testpaths]
- line += ", testpaths: {}".format(", ".join(rel_paths))
+ testpaths = config.getini("testpaths") # type: List[str]
+ if config.invocation_params.dir == config.rootpath and config.args == testpaths:
+ line += ", testpaths: {}".format(", ".join(testpaths))
+
result = [line]
plugininfo = config.pluginmanager.list_plugin_distinfo()