Skip to content

Conversation

@bluetech
Copy link
Member

In recent python versions all of the info is on the exception object itself so no reason to deal with the annoying tuple.

In recent python versions all of the info is on the exception object
itself so no reason to deal with the annoying tuple.
@bluetech bluetech merged commit 9af6d46 into pytest-dev:main Jan 15, 2024
@bluetech bluetech deleted the conftesterror-cleanup branch January 15, 2024 11:26
assert e.__traceback__ is not None
exc_info = (type(e), e, e.__traceback__)
raise ConftestImportFailure(conftestpath, exc_info) from e
raise ConftestImportFailure(conftestpath, cause=e) from e
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that data available via the context?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I started by using __cause__ but there are some issues with that, the typing is more annoying (can be None) and it's not available in the ctor, so went with the direct conversion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants