Skip to content

Commit 81811e0

Browse files
committed
Update README.rst
1 parent cba0779 commit 81811e0

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

README.rst

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
# pytest-qt #
1+
=========
2+
pytest-qt
3+
=========
24

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.
5+
pytest-qt is a `pytest <http://pytest.org>`_ plugin to allow
6+
programmers write tests for `PySide <https://pypi.python.org/pypi/PySide>`_ and
7+
`PyQt <http://www.riverbankcomputing.com/software/pyqt>`_ applications.
68

7-
The main usage is to use the `qtbot` fixture, responsible for handling `qApp` creation as needed and provides methods to
8-
simulate user interaction, like key presses and mouse clicks:
9+
The main usage is to use the `qtbot` fixture, responsible for handling `qApp`
10+
creation as needed and provides methods to simulate user interaction,
11+
like key presses and mouse clicks::
912

10-
```python
11-
def test_hello(qtbot):
12-
widget = HelloWidget()
13-
qtbot.addWidget(widget)
13+
14+
def test_hello(qtbot):
15+
widget = HelloWidget()
16+
qtbot.addWidget(widget)
1417
15-
# click in the Greet button and make sure it updates the appropriate label
16-
qtbot.mouseClick(window.button_greet, QtCore.Qt.LeftButton)
18+
# click in the Greet button and make sure it updates the appropriate label
19+
qtbot.mouseClick(window.button_greet, QtCore.Qt.LeftButton)
1720
18-
assert window.greet_label.text() == 'Hello!'
19-
```
21+
assert window.greet_label.text() == 'Hello!'
22+
2023

2124
This allows you to test and make sure your view layer is behaving the way you expect after each code change.
2225

0 commit comments

Comments
 (0)