pytest-dev / pytest-qt

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

Review pytest_qt_api checks #364

Closed The-Compiler closed 3 years ago

The-Compiler commented 3 years ago
tests/test_wait_signal.py
920:        if qt_api.pytest_qt_api != "pyside2":
921-            pytest.skip(
922-                "test only makes sense for PySide2, whose signals don't contain a name!"
--
1204:        if qt_api.pytest_qt_api != "pyside2":
1205-            pytest.skip(
1206-                "test only makes sense for PySide, whose signals don't contain a name!"

tests/test_logging.py
488:    if qt_api.pytest_qt_api == "pyqt5":
489-        res.stdout.fnmatch_lines(
490-            [
--
510:    if qt_api.pytest_qt_api != "pyqt5":
511-        pytest.skip("Context information only available in PyQt5")
512-    testdir.makepyfile(

src/pytestqt/logging.py
86:                        if qt_api.pytest_qt_api == "pyqt5":
87-                            context_format = "{rec.context.file}:{rec.context.function}:{rec.context.line}:\n"
88-                            log_format = "    {rec.type_name}: {rec.message}"

I suspect at least the logging context one isn't actually PyQt5-specific, and is available with PyQt6 (and perhaps PySide2/PySide6) too.