A note about
pytest-qt version 2.0,
PySide are lazily
loaded when first needed instead of at pytest startup. This usually means
pytest-qt will import
PySide when the tests actually start
running, well after
conftest.py files and other plugins have been imported.
This can lead to some unexpected behaviour if
pyqt4v2 is set.
conftest.py files, either directly or indirectly, set the API version
to 2 and import
PyQt4, one of the following cases can happen:
if all the available types are set to version 2, then using
if only some of the types set to version 2, using
pytestto fail with an error similar to:
INTERNALERROR> sip.setapi("QDate", 2) INTERNALERROR> ValueError: API 'QDate' has already been set to version 1
If this is the case, use
If the API is set in the test functions or in the code imported by them, then
the new behaviour is indistinguishable from the old one and
pyqt4v2 must be
used to avoid errors if version 2 is used.