Skip to content

Conversation

@nicoddemus
Copy link
Member

Now exception capturing is setup as early as possible, and disabled as late as possible. Also, this new approach allows us to distinguish exceptions captured during setup/call/teardown, which provides a more friendly message when the exception occurred inside the test call (as opposed during qtbot's teardown).

Fixes #105
Fixes #106

Copy link
Member

Choose a reason for hiding this comment

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

Why not simply:

exceptions = self.exceptions
self.exceptions = []

here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Of course! 😅

Done

@The-Compiler
Copy link
Member

Looks great apart from the things I commented on! It doesn't fix #106 though - I added a comment there to clear things up hopefully.

With this, I can finally develop complex fixtures without getting an abort() thrown at me 😉

@nicoddemus
Copy link
Member Author

Implemented the changes we talked about. Could you please test the new commits again? Thanks!

@The-Compiler
Copy link
Member

Yay, thanks again! I'll test and merge this either later today or tomorrow.

@nicoddemus
Copy link
Member Author

Nice, thanks!

Copy link
Member

Choose a reason for hiding this comment

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

This is also 2.8 specific 😉

Copy link
Member Author

Choose a reason for hiding this comment

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

Ooops. 😅

@The-Compiler
Copy link
Member

Looks good now, and fixes the issues I've had 👍

I think I'll give #107 a quick try on my way home (unless you want to), and after that, what do you think about a release?

The-Compiler added a commit that referenced this pull request Oct 30, 2015
Setup/teardown exception capturing as early/late as possible to catch all exceptions
@The-Compiler The-Compiler merged commit 6130dab into master Oct 30, 2015
@nicoddemus nicoddemus deleted the capture-setup-teardown branch October 30, 2015 11:52
@nicoddemus
Copy link
Member Author

I think I'll give #107 a quick try on my way home (unless you want to), and after that, what do you think about a release?

Please go ahead with #107, thanks! 😄

I would like to address pytest-dev/pytest-mock#22 as well into 1.9.0, if possible.

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