Skip to content

Serialize/deserialize chained exceptions #5787

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

Merged

Conversation

nicoddemus
Copy link
Member

This PR fixes serialization/deserialization of report objects, which fixes it for pytest-xdist (where #5786 originated).

  • Moved the contents of BaseReport._to_json/_from_json to free functions as they were getting quite large. More importantly, I refactored the code so it can be reused for chained exceptions.

  • Move TWMock class to a fixture so it can be more easily reused in other test modules. test_code was importing it using a relative import, which is not very nice.

Fix #5786

cc @oliveira-esss @prusse-martin

Refactoring this in order to support chained exceptions
more easily.

Related to pytest-dev#5786
Using a relative import like before was not very nice
Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

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

@nicoddemus nicoddemus force-pushed the chained-exceptions-serializable-5786 branch from 499c20a to a511b98 Compare August 29, 2019 23:24
@nicoddemus nicoddemus merged commit 01082fe into pytest-dev:master Aug 30, 2019
@nicoddemus nicoddemus deleted the chained-exceptions-serializable-5786 branch August 30, 2019 10:29
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.

exception serialization should include chained exceptions
2 participants