Skip to content

Commit 5aa1c5f

Browse files
committed
Updated documentation
1 parent 6540797 commit 5aa1c5f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

pytestqt/plugin.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def waitForWindowShown(self, widget):
202202
if hasattr(QtTest.QTest, 'qWaitForWindowShown'): # pragma: no cover
203203
# PyQt4 and PySide
204204
QtTest.QTest.qWaitForWindowShown(widget)
205-
else: # pragma: no cover
205+
else: # pragma: no cover
206206
# PyQt5
207207
QtTest.QTest.qWaitForWindowExposed(widget)
208208

@@ -382,6 +382,8 @@ def qapp():
382382
else:
383383
yield app # pragma: no cover
384384

385+
# holds a global QApplication instance created in the qapp fixture; keeping
386+
# this reference alive avoids it being garbage collected too early
385387
_qapp_instance = None
386388

387389

@@ -414,6 +416,10 @@ def pytest_addoption(parser):
414416

415417
@pytest.mark.hookwrapper
416418
def pytest_runtest_teardown():
419+
"""
420+
Hook called after each test tear down, to process any pending events and
421+
avoiding leaking events to the next test.
422+
"""
417423
yield
418424
app = QApplication.instance()
419425
if app is not None:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def run_tests(self):
3232
entry_points={
3333
'pytest11': ['pytest-qt = pytestqt.plugin'],
3434
},
35-
install_requires=['pytest>=2.3.4'],
35+
install_requires=['pytest>=2.7.0'],
3636

3737
# metadata for upload to PyPI
3838
author="Bruno Oliveira",

0 commit comments

Comments
 (0)