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

tests: pytest doesn't fail for unhandled exceptions in signal handlers #2705

Closed
lazka opened this issue Jan 9, 2018 · 2 comments
Closed
Milestone

Comments

@lazka
Copy link
Member

lazka commented Jan 9, 2018

pyqt has something to make it work: https://pytest-qt.readthedocs.io/en/2.3.1/virtual_methods.html

also pytest-dev/pytest#73

lazka added a commit that referenced this issue Jan 9, 2018
The test doesn't actually work due to #2705
lazka added a commit to lazka/quodlibet that referenced this issue Jan 9, 2018
…on an reraise them. Fixes quodlibet#2705

Exceptions raised during signals don't bubble to the test caller, instead they
get pushed into sys.excepthook which by default prints them.

This adds a pytest plugin which wraps each test (I think..) collects uncaught exceptions
and reraises them at the end.

This uncovers a few bugs, so this makes the tests fail atm.
@lazka
Copy link
Member Author

lazka commented Jan 9, 2018

9 tests are failing due to this, better look at it before 4.0.1

@lazka lazka added this to the 4.0.1 milestone Jan 9, 2018
@declension
Copy link
Member

Cool. I've noticed this problem a couple of times too actually - adding a test that "fails" but only if you look at debug logs a lot...

@lazka lazka closed this as completed in 2aeea94 Jan 10, 2018
lazka added a commit that referenced this issue Jan 10, 2018
tests: capture exceptions that are not caught during the test execution an reraise them. Fixes #2705
lazka added a commit that referenced this issue Jan 10, 2018
The test doesn't actually work due to #2705
lazka added a commit that referenced this issue Jan 10, 2018
…on an reraise them. Fixes #2705

Exceptions raised during signals don't bubble to the test caller, instead they
get pushed into sys.excepthook which by default prints them.

This adds a pytest plugin which wraps each test (I think..) collects uncaught exceptions
and reraises them at the end.

This uncovers some bugs in the playlistbrowser tests. Most of the inherited tests were
failing, and I think they never passed, so just remove the inheritance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants