Skip to content

Commit

Permalink
Bump minimum pytest version to 3.0 (#267)
Browse files Browse the repository at this point in the history
Bump minimum pytest version to 3.0
  • Loading branch information
nicoddemus committed Jul 14, 2019
2 parents a4f6a71 + fbd214b commit d15703f
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
@@ -1,8 +1,9 @@
3.2.3 (unreleased)
3.3.0 (unreleased)
------------------

- Improve message in uncaught exceptions by mentioning the Qt event loop instead of
Qt virtual methods (`#255`_).
- ``pytest-qt`` now requires ``pytest`` version >= 3.0.

.. _#255: https://github.com/pytest-dev/pytest-qt/pull/255

Expand Down
2 changes: 1 addition & 1 deletion docs/intro.rst
Expand Up @@ -28,7 +28,7 @@ Requirements

Python 2.7 or later, including Python 3.4+.

Requires pytest version 2.7 or later.
Requires pytest version 3.0 or later.

Works with either ``PyQt5``, ``PyQt4``, ``PySide`` or ``PySide2``, picking whichever
is available on the system giving preference to the first one installed in
Expand Down
8 changes: 4 additions & 4 deletions pytestqt/plugin.py
Expand Up @@ -42,7 +42,7 @@ def qapp_args():
return []


@pytest.yield_fixture(scope="session")
@pytest.fixture(scope="session")
def qapp(qapp_args):
"""
Fixture that instantiates the QApplication instance that will be used by
Expand All @@ -55,9 +55,9 @@ def qapp(qapp_args):
if app is None:
global _qapp_instance
_qapp_instance = qt_api.QApplication(qapp_args)
yield _qapp_instance
return _qapp_instance
else:
yield app # pragma: no cover
return app # pragma: no cover


# holds a global QApplication instance created in the qapp fixture; keeping
Expand Down Expand Up @@ -86,7 +86,7 @@ def qtlog(request):
return _QtMessageCapture([]) # pragma: no cover


@pytest.yield_fixture
@pytest.fixture
def qtmodeltester(request):
"""
Fixture used to create a ModelTester instance to test models.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -27,7 +27,7 @@ def run_tests(self):
name="pytest-qt",
packages=["pytestqt"],
entry_points={"pytest11": ["pytest-qt = pytestqt.plugin"]},
install_requires=["pytest>=2.7.0"],
install_requires=["pytest>=3.0.0"],
extras_require={"doc": ["sphinx", "sphinx_rtd_theme"]},
# metadata for upload to PyPI
author="Bruno Oliveira",
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Expand Up @@ -42,7 +42,7 @@ def check(self, timeout, *delays):
return StopWatch()


@pytest.yield_fixture
@pytest.fixture
def timer():
"""
Returns a Timer-like object which can be used to trigger signals and callbacks
Expand Down
4 changes: 2 additions & 2 deletions tests/test_basics.py
Expand Up @@ -170,7 +170,7 @@ def event(self, ev):
return EventsQueue()
@pytest.yield_fixture
@pytest.fixture
def fix(events_queue, qapp):
assert events_queue.events == []
yield
Expand Down Expand Up @@ -260,7 +260,7 @@ def closeEvent(self, e):
e.accept()
self.closed = True
@pytest.yield_fixture
@pytest.fixture
def widget(qtbot):
w = Widget()
qtbot.add_widget(w)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_exceptions.py
Expand Up @@ -250,7 +250,7 @@ def event(self, ev):
raise RuntimeError('event processed')
return True
@pytest.yield_fixture
@pytest.fixture
def widget(qapp):
w = MyWidget()
{setup_code}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_wait_until.py
Expand Up @@ -38,7 +38,7 @@ def check_ticks():
return check_ticks


@pytest.yield_fixture
@pytest.fixture
def tick_counter():
"""
Returns an object which counts timer "ticks" periodically.
Expand Down

0 comments on commit d15703f

Please sign in to comment.