Skip to content

Commit

Permalink
notify_exception without 'terminal' plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ikonst committed Apr 17, 2019
1 parent 9eac473 commit 24fac2e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/_pytest/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ def pytest_cmdline_parse(self, pluginmanager, args):
return self

def notify_exception(self, excinfo, option=None):
if option and option.fulltrace:
if option and getattr(option, 'fulltrace', False):
style = "long"
else:
style = "native"
Expand Down
11 changes: 9 additions & 2 deletions testing/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ def test_notify_exception(testdir, capfd):
config = testdir.parseconfig()
with pytest.raises(ValueError) as excinfo:
raise ValueError(1)
config.notify_exception(excinfo)
config.notify_exception(excinfo, config.option)
out, err = capfd.readouterr()
assert "ValueError" in err

Expand All @@ -779,10 +779,17 @@ def pytest_internalerror(self, excrepr):
return True

config.pluginmanager.register(A())
config.notify_exception(excinfo)
config.notify_exception(excinfo, config.option)
out, err = capfd.readouterr()
assert not err

config = testdir.parseconfig('-p', 'no:terminal')
with pytest.raises(ValueError) as excinfo:
raise ValueError(1)
config.notify_exception(excinfo, config.option)
out, err = capfd.readouterr()
assert "ValueError" in err


def test_load_initial_conftest_last_ordering(testdir, _config_for_test):
pm = _config_for_test.pluginmanager
Expand Down

0 comments on commit 24fac2e

Please sign in to comment.