File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ def waitForWindowShown(self, widget):
202
202
if hasattr (QtTest .QTest , 'qWaitForWindowShown' ): # pragma: no cover
203
203
# PyQt4 and PySide
204
204
QtTest .QTest .qWaitForWindowShown (widget )
205
- else : # pragma: no cover
205
+ else : # pragma: no cover
206
206
# PyQt5
207
207
QtTest .QTest .qWaitForWindowExposed (widget )
208
208
@@ -382,6 +382,8 @@ def qapp():
382
382
else :
383
383
yield app # pragma: no cover
384
384
385
+ # holds a global QApplication instance created in the qapp fixture; keeping
386
+ # this reference alive avoids it being garbage collected too early
385
387
_qapp_instance = None
386
388
387
389
@@ -414,6 +416,10 @@ def pytest_addoption(parser):
414
416
415
417
@pytest .mark .hookwrapper
416
418
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
+ """
417
423
yield
418
424
app = QApplication .instance ()
419
425
if app is not None :
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def run_tests(self):
32
32
entry_points = {
33
33
'pytest11' : ['pytest-qt = pytestqt.plugin' ],
34
34
},
35
- install_requires = ['pytest>=2.3.4 ' ],
35
+ install_requires = ['pytest>=2.7.0 ' ],
36
36
37
37
# metadata for upload to PyPI
38
38
author = "Bruno Oliveira" ,
You can’t perform that action at this time.
0 commit comments