Skip to content

Commit

Permalink
Revert "tbstyle_given"
Browse files Browse the repository at this point in the history
This reverts commit 9808c46.
  • Loading branch information
blueyed committed Nov 3, 2020
1 parent 0d46cea commit 5a7dd10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/_pytest/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,6 @@ def __init__(self, pluginmanager, *, invocation_params=None) -> None:
)

self.option = argparse.Namespace()
self._nondefault_options = set() # type: Set[str]
self.invocation_params = invocation_params

_a = FILE_OR_DIR
Expand Down Expand Up @@ -892,10 +891,9 @@ def _processopt(self, opt: "Argument") -> None:
for name in opt._short_opts + opt._long_opts:
self._opt2dest[name] = opt.dest

if hasattr(self.option, opt.dest):
self._nondefault_options.add(opt.dest)
elif hasattr(opt, "default"):
setattr(self.option, opt.dest, opt.default)
if hasattr(opt, "default"):
if not hasattr(self.option, opt.dest):
setattr(self.option, opt.dest, opt.default)

@hookimpl(trylast=True)
def pytest_load_initial_conftests(self, early_config):
Expand Down
4 changes: 2 additions & 2 deletions src/_pytest/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,11 @@ def _repr_failure_py(
return excinfo.value.formatrepr()

# XXX should excinfo.getrepr record all data and toterminal() process it?
# XXX: does not distinguish between default/unset and --tb=auto.
tbstyle = self.config.option.tbstyle
verbosity = self.config.option.verbose
if fulltrace:
tbstyle_given = "tbstyle" in self.config._nondefault_options
style = tbstyle if tbstyle_given else "long" # type: _TracebackStyle
style = "long" if tbstyle == "auto" else tbstyle # type: _TracebackStyle
else:
if tbstyle == "auto":
if default_style is None:
Expand Down

0 comments on commit 5a7dd10

Please sign in to comment.