Qt Test Patterns
Installation
SKILL.md
Qt Test Patterns
Qt testing spans three ecosystems: C++ QTest (native, zero dependencies), Python pytest-qt (PySide6 apps), and QML TestCase (QML component logic). This skill covers all three with CMake integration.
Choosing a Test Framework
| Scenario | Framework |
|---|---|
| C++ Qt classes / business logic | C++ QTest (QObject subclass + QTEST_MAIN) |
| PySide6 GUI application | pytest + pytest-qt (qtbot fixture) |
| QML component behavior | QtQuickTest (TestCase QML type) |
| PySide6 non-GUI logic | pytest (no pytest-qt needed) |
Python / PySide6 with pytest-qt
Complete pytest-qt patterns — see references/python-pytest-qt.md for the full qtbot fixture API, signal waiting, conftest patterns, model testing, parametrize, async tests, and common gotchas.
Key config:
Related skills