Skip to content

Commit f2f7f91

Browse files
committed
Merge branch 'readme-rst'
2 parents f0e93a3 + 44af1ba commit f2f7f91

File tree

3 files changed

+87
-61
lines changed

3 files changed

+87
-61
lines changed

README.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

README.rst

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
=========
2+
pytest-qt
3+
=========
4+
5+
pytest-qt is a `pytest`_ plugin to allow programmers write tests for `PySide`_ and `PyQt`_ applications.
6+
7+
The main usage is to use the `qtbot` fixture, responsible for handling `qApp`
8+
creation as needed and provides methods to simulate user interaction,
9+
like key presses and mouse clicks:
10+
11+
12+
.. code-block:: python
13+
14+
def test_hello(qtbot):
15+
widget = HelloWidget()
16+
qtbot.addWidget(widget)
17+
18+
# click in the Greet button and make sure it updates the appropriate label
19+
qtbot.mouseClick(window.button_greet, QtCore.Qt.LeftButton)
20+
21+
assert window.greet_label.text() == 'Hello!'
22+
23+
24+
.. _PySide: https://pypi.python.org/pypi/PySide
25+
.. _PyQt: http://www.riverbankcomputing.com/software/pyqt
26+
.. _pytest: http://pytest.org
27+
28+
This allows you to test and make sure your view layer is behaving the way you expect after each code change.
29+
30+
|version| |downloads| |ci|
31+
32+
.. |version| image:: http://img.shields.io/pypi/v/pytest-qt.png
33+
:target: https://crate.io/packages/pytest-qt
34+
35+
.. |downloads| image:: http://img.shields.io/pypi/dm/pytest-qt.png
36+
:target: https://crate.io/packages/pytest-qt
37+
38+
.. |ci| image:: http://img.shields.io/travis/nicoddemus/pytest-qt.png
39+
:target: https://travis-ci.org/nicoddemus/pytest-qt
40+
41+
42+
Requirements
43+
------------
44+
45+
Python 2.6 or later, including Python 3+.
46+
47+
Works with either PySide_ or
48+
PyQt_ picking whichever is available on the system, giving
49+
preference to ``PySide`` if both are installed (to force it to use ``PyQt``, set
50+
the environment variable ``PYTEST_QT_FORCE_PYQT=true``).
51+
52+
Documentation
53+
-------------
54+
55+
Full documentation and tutorial available at `Read the Docs`_.
56+
57+
.. _Read The Docs: https://pytest-qt.readthedocs.org/en/latest/
58+
59+
Change Log
60+
----------
61+
62+
Please consult the `releases page`_.
63+
64+
.. _releases page: https://github.com/nicoddemus/pytest-qt/releases
65+
66+
Bugs/Requests
67+
-------------
68+
69+
Please report any issues or feature requests in the `issue tracker`_.
70+
71+
.. _issue tracker: https://github.com/nicoddemus/pytest-qt/issues

setup.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
from setuptools import setup, find_packages
1+
from setuptools import setup
22
import pytestqt
33

4-
description = "pytest plugin that adds fixtures for testing Qt (PyQt and PySide) applications."
4+
55
setup(
6-
name = "pytest-qt",
7-
version = pytestqt.version,
8-
packages = ['pytestqt', 'pytestqt._tests'],
9-
entry_points = {
10-
'pytest11' : ['pytest-qt = pytestqt.plugin'],
6+
name="pytest-qt",
7+
version=pytestqt.version,
8+
packages=['pytestqt', 'pytestqt._tests'],
9+
entry_points={
10+
'pytest11': ['pytest-qt = pytestqt.plugin'],
1111
},
12-
install_requires = ['pytest>=2.3.4'],
13-
12+
install_requires=['pytest>=2.3.4'],
13+
1414
# metadata for upload to PyPI
15-
author = "Bruno Oliveira",
16-
author_email = "[email protected]",
17-
description = description,
18-
license = "LGPL",
19-
keywords = "pytest qt test unittest",
20-
url = "http://github.com/nicoddemus/pytest-qt",
15+
author="Bruno Oliveira",
16+
author_email="[email protected]",
17+
description='pytest support for PyQt and PySide applications',
18+
long_description=open('README.rst').read(),
19+
license="LGPL",
20+
keywords="pytest qt test unittest",
21+
url="http://github.com/nicoddemus/pytest-qt",
2122
classifiers=[
2223
'Development Status :: 5 - Production/Stable',
2324
'Intended Audience :: Developers',

0 commit comments

Comments
 (0)