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
|
Pulkit Goyal
|
||||||
Punyashloka Biswal
|
Punyashloka Biswal
|
||||||
Quentin Pradet
|
Quentin Pradet
|
||||||
|
q0w
|
||||||
Ralf Schmitt
|
Ralf Schmitt
|
||||||
Ralph Giles
|
Ralph Giles
|
||||||
Ram Rachum
|
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.
|
and ``session.items`` is empty.
|
||||||
"""
|
"""
|
||||||
if args is None:
|
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("perform_collect", self, args)
|
||||||
self.trace.root.indent += 1
|
self.trace.root.indent += 1
|
||||||
|
|
|
@ -737,8 +737,10 @@ class TerminalReporter:
|
||||||
|
|
||||||
if config.inipath:
|
if config.inipath:
|
||||||
line += ", configfile: " + bestrelpath(config.rootpath, config.inipath)
|
line += ", configfile: " + bestrelpath(config.rootpath, config.inipath)
|
||||||
|
if (
|
||||||
if config.args_source == Config.ArgsSource.TESTPATHS:
|
hasattr(config, "args_source")
|
||||||
|
and config.args_source == Config.ArgsSource.TESTPATHS
|
||||||
|
):
|
||||||
testpaths: List[str] = config.getini("testpaths")
|
testpaths: List[str] = config.getini("testpaths")
|
||||||
line += ", testpaths: {}".format(", ".join(testpaths))
|
line += ", testpaths: {}".format(", ".join(testpaths))
|
||||||
|
|
||||||
|
|
|
@ -3338,6 +3338,10 @@ class TestShowFixtures:
|
||||||
config = pytester.parseconfigure("--funcargs")
|
config = pytester.parseconfigure("--funcargs")
|
||||||
assert config.option.showfixtures
|
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:
|
def test_show_fixtures(self, pytester: Pytester) -> None:
|
||||||
result = pytester.runpytest("--fixtures")
|
result = pytester.runpytest("--fixtures")
|
||||||
result.stdout.fnmatch_lines(
|
result.stdout.fnmatch_lines(
|
||||||
|
|
Loading…
Reference in New Issue