$npx skillfedfor your agent

pytest-qt

pytest support for PyQt and PySide applications

Worth itPyPI TestingReleased Jul 20251.2M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pytest_qt-4.5.0-py3-none-any.whl
v4.5.0 · released 2025-07-01 · Python >=3.9 · 3 runtime deps: pytest, pluggy, typing_extensions

Yes. pytest-qt is production-stable (since 2013), actively maintained, has no known vulnerabilities, and installs with low friction. Install it if you're testing PyQt or PySide applications and want pytest-native fixtures for widget interaction and signal handling. The only prerequisite is having one of PyQt5, PyQt6, or PySide6 already available.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires PyQt5, PyQt6, or PySide6 to be installed separately; pytest-qt will auto-detect or you can set qt_api in pytest.ini or PYTEST_QT_API environment variable.
  • Low friction install with stable maintenance: the package is actively maintained (last commit 2026-08-03), has been in production since 2013, and depends only on pytest, pluggy, and typing_extensions—all widely available.

License · maintenance · safety

MIT (permissive) — MIT license is permissive; you can use this package in commercial or proprietary projects with minimal restrictions, provided you include the license notice.

last release 2025-07-01 (409 days) · last repo commit 2026-08-03 · 455 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,187,026 downloads/mo, #4,247 on PyPI

Verify before relying

pip install pytest-qt

# In your test file:
def test_widget(qtbot):
    widget = MyWidget()
    qtbot.addWidget(widget)
    qtbot.mouseClick(widget.button, qt_api.QtCore.Qt.MouseButton.LeftButton)
  • Whether the package handles headless/CI environments without additional configuration beyond pytest-xvfb.
  • Performance characteristics when testing large widget hierarchies or many signals.
  • Compatibility guarantees across PyQt5/PyQt6/PySide6 API differences in test code.
Same gist for agents: .md · .json

What it is and what it does

pytest-qt bridges pytest and Qt application testing by providing the qtbot fixture, which manages Qt application lifecycle and exposes methods to simulate user interactions like mouse clicks and key presses. It also captures Qt debug/warning/critical messages automatically and provides waitSignal/waitSignals functions to block tests until specific signals are emitted, plus automatic exception handling in virtual methods and slots.

The plugin auto-detects which Qt library (PySide6, PyQt6, or PyQt5) is available or already imported, or lets you force a choice via pytest.ini or environment variable. It's designed for developers who need to verify that the view layer of a Qt application behaves correctly after code changes, without requiring manual GUI interaction.

Use it for

  • Test button clicks and user input on PyQt5/PyQt6/PySide6 widgets to verify UI state changes.
  • Verify that Qt signals are emitted at the right time using waitSignal/waitSignals in your test suite.
  • Capture and assert on qDebug, qWarning, and qCritical messages emitted during widget operations.
  • Validate exception handling in Qt virtual methods and slots by letting pytest-qt catch and report them.
  • Automate GUI regression testing in CI pipelines by simulating user interactions programmatically.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

pytest-qt is production-stable (since 2013), actively maintained, has no known vulnerabilities, and installs with low friction. Install it if you're testing PyQt or PySide applications and want pytest-native fixtures for widget interaction and signal handling. The only prerequisite is having one of PyQt5, PyQt6, or PySide6 already available.

Install

pytest-qt on PyPI

Before you install

Low friction install with stable maintenance: the package is actively maintained (last commit 2026-08-03), has been in production since 2013, and depends only on pytest, pluggy, and typing_extensions—all widely available.

Requires PyQt5, PyQt6, or PySide6 to be installed separately; pytest-qt will auto-detect or you can set qt_api in pytest.ini or PYTEST_QT_API environment variable.

License in practice

MIT license is permissive; you can use this package in commercial or proprietary projects with minimal restrictions, provided you include the license notice.

Quickstart

pip install pytest-qt

# In your test file:
def test_widget(qtbot):
    widget = MyWidget()
    qtbot.addWidget(widget)
    qtbot.mouseClick(widget.button, qt_api.QtCore.Qt.MouseButton.LeftButton)

Verify before relying

  • Whether the package handles headless/CI environments without additional configuration beyond pytest-xvfb.
  • Performance characteristics when testing large widget hierarchies or many signals.
  • Compatibility guarantees across PyQt5/PyQt6/PySide6 API differences in test code.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.9
Install frictionLow. Pure-Python wheel
Runtime dependencies
3 packages
pytestpluggytyping_extensions
MaintenanceActively maintained 409 days since the last release
Last repo commit
First released
Downloads1,187,026 / month, #4,247 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Desktop Environment :: Window ManagersTopic :: Software Development :: Quality AssuranceTopic :: Software Development :: TestingTopic :: Software Development :: User Interfaces

Evidence: pytest_qt-4.5.0-py3-none-any.whl

Tags

Capabilities
pytest qt testingpyqt test fixturepyside6 testingqt widget testinggui test automationqtbot fixtureqt signal testing
Topics
qt-testinggui-automationpytest-plugin
PyPI keywords
pytestqttestunittest

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “pytest qt testing”

  • pytest-qtpytest-qt is a pytest plugin that provides fixtures and utilities to…
  • QtPyQtPy provides a unified API for writing Qt applications that work…
  • aqtaqt is the Qt-based desktop GUI for Anki, the spaced repetition…

Give your agent the search over MCP, or paste the wish link into any chat.

More Testing packages

pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.

MITpure Python · 3.10+
1.1Bdownloads / mo
virtualenv Worth it
PyPI · Libraries · released Aug 2026

virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.

MITpure Python · 3.9+
532.9Mdownloads / mo
coverage Worth it
PyPI · Testing · released Aug 2026

Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.

Install it if you want to measure test completeness or enforce coverage thresholds in your project.

permissive licensepure Python · 3.10+
335.8Mdownloads / mo
pytest-asyncio Worth it
PyPI · Testing · released May 2026

pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.

Install it if you write tests for any asyncio-based code.

Apache-2.0pure Python · 3.10+
275.9Mdownloads / mo
pytest-json-ctrf Worth it
PyPI · Testing · released Jul 2026

A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.

Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.

MITpure Python · 3.8+
273.0Mdownloads / mo

See also pytest-selenium · QtPy · pyqt5-tools · pytest-rabbitmq · pytest-redis · pytest-aiohttp · tdd-guard-pytest · qtconsole · pytest-django