Fix crash when discovery fails while using `-p no:terminal`
This commit is contained in:
parent
65fbdf2568
commit
4e723d6750
|
@ -0,0 +1 @@
|
||||||
|
Fix crash when discovery fails while using ``-p no:terminal``.
|
|
@ -323,7 +323,7 @@ class Collector(Node):
|
||||||
|
|
||||||
# Respect explicit tbstyle option, but default to "short"
|
# Respect explicit tbstyle option, but default to "short"
|
||||||
# (None._repr_failure_py defaults to "long" without "fulltrace" option).
|
# (None._repr_failure_py defaults to "long" without "fulltrace" option).
|
||||||
tbstyle = self.config.getoption("tbstyle")
|
tbstyle = self.config.getoption("tbstyle", "auto")
|
||||||
if tbstyle == "auto":
|
if tbstyle == "auto":
|
||||||
tbstyle = "short"
|
tbstyle = "short"
|
||||||
|
|
||||||
|
|
|
@ -741,10 +741,10 @@ def test_config_in_subdirectory_colon_command_line_issue2148(testdir):
|
||||||
**{
|
**{
|
||||||
"conftest": conftest_source,
|
"conftest": conftest_source,
|
||||||
"subdir/conftest": conftest_source,
|
"subdir/conftest": conftest_source,
|
||||||
"subdir/test_foo": """
|
"subdir/test_foo": """\
|
||||||
def test_foo(pytestconfig):
|
def test_foo(pytestconfig):
|
||||||
assert pytestconfig.getini('foo') == 'subdir'
|
assert pytestconfig.getini('foo') == 'subdir'
|
||||||
""",
|
""",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -777,6 +777,12 @@ def test_notify_exception(testdir, capfd):
|
||||||
assert "ValueError" in err
|
assert "ValueError" in err
|
||||||
|
|
||||||
|
|
||||||
|
def test_no_terminal_discovery_error(testdir):
|
||||||
|
testdir.makepyfile("raise TypeError('oops!')")
|
||||||
|
result = testdir.runpytest("-p", "no:terminal", "--collect-only")
|
||||||
|
assert result.ret == ExitCode.INTERRUPTED
|
||||||
|
|
||||||
|
|
||||||
def test_load_initial_conftest_last_ordering(testdir, _config_for_test):
|
def test_load_initial_conftest_last_ordering(testdir, _config_for_test):
|
||||||
pm = _config_for_test.pluginmanager
|
pm = _config_for_test.pluginmanager
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue