Closed oscargus closed 1 year ago
Yeah not sure if it is a good idea either, because this will just hide the problem entirely... in this case I think it is reasonable to scale the problem up so the user can do something about it.
Agreed. A ModuleNotFoundError
is expected in normal day-to-day usage, but any other ImportError
is not, and we shouldn't hide it from the user - a loud failure is better than a silent one.
It also looks like this was changed away from ImportError
back when dropping Python 2: https://github.com/pytest-dev/pytest-qt/commit/2fc8f680d927b5eeb2de7a66628e7806a06a58f4#diff-04278337b26277c6d10e922eba6f555e9883405df1485c40ead631156499d7b3
Alright! I see your point and cannot really disagree with it. (Although it would be more "convenient" for me to catch it...) Will close!
It seems like it is possible that either PyQt6 or PySide6 (not clear which) do not fully uninstall. In this case I got:
prohibiting any test runs unless I set
PYTEST_QT_API
.It may be a good idea (or not) to check for ImportError here to avoid this problem: https://github.com/pytest-dev/pytest-qt/blob/c78d21c6c5404f73ef7bfa82ad4806a095c5e1bc/src/pytestqt/qt_compat.py#L70
If you think it is a good idea, I can prepare a patch. (Although I have no idea how to test it, apart from the indication if it runs on my computer with the broken uninstall...)
(Windows 11, I got some error when I installed PyQt6, but has since installed and reinstalled again, this time without any error, still the above happens.)