pytest-dev / pytest-qt

pytest plugin for Qt (PyQt5/PyQt6 and PySide2/PySide6) application testing
https://pytest-qt.readthedocs.io
MIT License
410 stars 70 forks source link

Fix test_exceptions_dont_leak in Python 3.12 #535

Closed nicoddemus closed 10 months ago

nicoddemus commented 11 months ago

I wonder if clearing it is the right call, after all the purpose of sys.last_exc is for post-mortem debugging -- however I'm not sure that at that point is possible to breakpoint at that point.

Fixes #532

nicoddemus commented 10 months ago

Thought about this some more, I think this is fine because we are clearing the attribute past the lifetime of the test, so it should be fine and goes with the purpose of the original issue of avoiding leaking data from one test to another.

We can revisit this if it proves problematic in the future.

Thanks everyone for chiming in. 👍