Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CallInfo.from_call cuts off traceback for exceptions #6081

Closed
blueyed opened this issue Oct 27, 2019 · 1 comment · May be fixed by blueyed/pytest#20
Closed

CallInfo.from_call cuts off traceback for exceptions #6081

blueyed opened this issue Oct 27, 2019 · 1 comment · May be fixed by blueyed/pytest#20
Labels
topic: reporting related to terminal output and user-facing messages and errors type: enhancement new feature or API change, should be merged into features branch

Comments

@blueyed
Copy link
Contributor

blueyed commented Oct 27, 2019

Code:

try:
result = func()
except: # noqa
excinfo = ExceptionInfo.from_current()
if reraise is not None and excinfo.errisinstance(reraise):
raise
result = None
stop = time()
return cls(start=start, stop=stop, when=when, result=result, excinfo=excinfo)

It would be good if exceptions being caught/handled there would still have the full traceback.

With Python 3.7 at least we could use types.TracebackType, and create entries based on the frame stack there then.

@blueyed
Copy link
Contributor Author

blueyed commented Oct 27, 2019

See blueyed#20 - testing/code/test_excinfo.py needs quite some adjustments, so I'd be happy about feedback.

Edit: changed to use an explicit merge_frame argument for/with from_call then.

@Zac-HD Zac-HD added topic: reporting related to terminal output and user-facing messages and errors type: enhancement new feature or API change, should be merged into features branch labels Oct 28, 2019
blueyed added a commit to blueyed/pytest that referenced this issue Nov 1, 2019
blueyed added a commit to blueyed/pytest that referenced this issue Nov 1, 2019
blueyed added a commit to blueyed/pytest that referenced this issue Nov 4, 2019
blueyed added a commit to blueyed/pytest that referenced this issue Nov 8, 2019
Save original/current `pdb.set_trace` on the instance, not class.
Tried to keep this minimal, more fixes forthcoming.

Fixes pytest-dev#5228 properly (previously 9129ad3).

Conflicts with pytest-dev/features due to:

- cd10ee1 (minor, "improve header for _enter_pdb" (#21))
- 9659ce0 ("pdb: set excinfo in _postmortem_traceback, cut", #16; only a hack - WIP at #20 (ref: pytest-dev#6081))
@blueyed blueyed closed this as completed Nov 27, 2019
blueyed added a commit to blueyed/pytest that referenced this issue Feb 3, 2020
blueyed added a commit to blueyed/pytest that referenced this issue Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: reporting related to terminal output and user-facing messages and errors type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants