How to run and write tests¶
Run the test suite and add tests for new behaviour in ezqt-widgets.
๐ง Prerequisites¶
- Development environment set up (How to set up a dev environment)
๐งช Run the full test suite¶
You should see a summary showing all tests passed.
๐ Run with coverage¶
โ๏ธ Write a new test¶
-
Create a test file in
tests/following the naming conventiontest_<module>.py. -
Write your test using
pytestconventions.
from PySide6.QtWidgets import QApplication
from ezqt_widgets import IconButton
def test_icon_button_default_text():
app = QApplication.instance() or QApplication([])
btn = IconButton(text="Hello")
assert btn is not None
- Run the test in isolation to verify it passes.
โ Result¶
All tests pass and coverage remains above the configured threshold.