terminal: handle "capture" option not being available
This is the case with `-p no:capture` now.
This commit is contained in:
parent
415899d428
commit
c7c120fba6
|
@ -246,7 +246,7 @@ class TerminalReporter(object):
|
||||||
def _determine_show_progress_info(self):
|
def _determine_show_progress_info(self):
|
||||||
"""Return True if we should display progress information based on the current config"""
|
"""Return True if we should display progress information based on the current config"""
|
||||||
# do not show progress if we are not capturing output (#3038)
|
# do not show progress if we are not capturing output (#3038)
|
||||||
if self.config.getoption("capture") == "no":
|
if self.config.getoption("capture", "no") == "no":
|
||||||
return False
|
return False
|
||||||
# do not show progress if we are showing fixture setup/teardown
|
# do not show progress if we are showing fixture setup/teardown
|
||||||
if self.config.getoption("setupshow"):
|
if self.config.getoption("setupshow"):
|
||||||
|
@ -456,7 +456,7 @@ class TerminalReporter(object):
|
||||||
self._tw.write(msg + "\n", cyan=True)
|
self._tw.write(msg + "\n", cyan=True)
|
||||||
|
|
||||||
def _get_progress_information_message(self):
|
def _get_progress_information_message(self):
|
||||||
if self.config.getoption("capture") == "no":
|
if self.config.getoption("capture", "no") == "no":
|
||||||
return ""
|
return ""
|
||||||
collected = self._session.testscollected
|
collected = self._session.testscollected
|
||||||
if self.config.getini("console_output_style") == "count":
|
if self.config.getini("console_output_style") == "count":
|
||||||
|
|
|
@ -1182,7 +1182,7 @@ def test_help_and_version_after_argument_error(testdir):
|
||||||
def test_config_does_not_load_blocked_plugin_from_args(testdir):
|
def test_config_does_not_load_blocked_plugin_from_args(testdir):
|
||||||
"""This tests that pytest's config setup handles "-p no:X"."""
|
"""This tests that pytest's config setup handles "-p no:X"."""
|
||||||
p = testdir.makepyfile("def test(capfd): pass")
|
p = testdir.makepyfile("def test(capfd): pass")
|
||||||
result = testdir.runpytest(str(p), "-pno:capture", "--tb=native")
|
result = testdir.runpytest(str(p), "-pno:capture")
|
||||||
result.stdout.fnmatch_lines(["E fixture 'capfd' not found"])
|
result.stdout.fnmatch_lines(["E fixture 'capfd' not found"])
|
||||||
assert result.ret == EXIT_TESTSFAILED
|
assert result.ret == EXIT_TESTSFAILED
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue