File tree Expand file tree Collapse file tree 2 files changed +21
-11
lines changed Expand file tree Collapse file tree 2 files changed +21
-11
lines changed Original file line number Diff line number Diff line change
1
+ # pytest-qt #
2
+
3
+ pytest-qt is a [ pytest] ( http://pytest.org ) plugin that provides fixtures to help
4
+ programmers write tests for [ PySide] ( https://pypi.python.org/pypi/PySide ) and [ PyQt] ( http://www.riverbankcomputing.com/software/pyqt )
5
+ applications.
6
+
7
+ The main usage is to use the qtbot fixture, which provides methods to simulate user interaction, like key presses and mouse clicks:
8
+
9
+ ```
10
+ def test_hello(qtbot):
11
+ widget = HelloWidget()
12
+ qtbot.addWidget(widget)
13
+
14
+ # click in the Greet button and make sure it updates the appropriate label
15
+ qtbot.mouseClick(window.button_greet, QtCore.Qt.LeftButton)
16
+
17
+ assert window.greet_label.text() == 'Hello!'
18
+ ```
19
+
20
+ Full documentation and tutorial available at ` Read the Docs ` _ .
21
+
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments