Check if config args and args_source exist
This commit is contained in:
parent
03b19945fb
commit
ee57a2ad45
1
AUTHORS
1
AUTHORS
|
@ -290,6 +290,7 @@ Prashant Sharma
|
|||
Pulkit Goyal
|
||||
Punyashloka Biswal
|
||||
Quentin Pradet
|
||||
q0w
|
||||
Ralf Schmitt
|
||||
Ralph Giles
|
||||
Ram Rachum
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Check if ``Config.args`` and ``Config.args_source`` exist.
|
|
@ -619,7 +619,7 @@ class Session(nodes.FSCollector):
|
|||
and ``session.items`` is empty.
|
||||
"""
|
||||
if args is None:
|
||||
args = self.config.args
|
||||
args = self.config.args if hasattr(self.config, "args") else ()
|
||||
|
||||
self.trace("perform_collect", self, args)
|
||||
self.trace.root.indent += 1
|
||||
|
|
|
@ -737,8 +737,10 @@ class TerminalReporter:
|
|||
|
||||
if config.inipath:
|
||||
line += ", configfile: " + bestrelpath(config.rootpath, config.inipath)
|
||||
|
||||
if config.args_source == Config.ArgsSource.TESTPATHS:
|
||||
if (
|
||||
hasattr(config, "args_source")
|
||||
and config.args_source == Config.ArgsSource.TESTPATHS
|
||||
):
|
||||
testpaths: List[str] = config.getini("testpaths")
|
||||
line += ", testpaths: {}".format(", ".join(testpaths))
|
||||
|
||||
|
|
|
@ -3338,6 +3338,10 @@ class TestShowFixtures:
|
|||
config = pytester.parseconfigure("--funcargs")
|
||||
assert config.option.showfixtures
|
||||
|
||||
def test_show_help(self, pytester: Pytester) -> None:
|
||||
result = pytester.runpytest("--fixtures", "--help")
|
||||
assert not result.ret
|
||||
|
||||
def test_show_fixtures(self, pytester: Pytester) -> None:
|
||||
result = pytester.runpytest("--fixtures")
|
||||
result.stdout.fnmatch_lines(
|
||||
|
|
Loading…
Reference in New Issue