Skip to content

Commit 21a0f94

Browse files
atugushevTinche
authored andcommitted
Replace yield_fixture() by fixture()
@pytest.yeld_fixture is deprecated since pytest-3.0, see: https://docs.pytest.org/en/latest/yieldfixture.html
1 parent 964b295 commit 21a0f94

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ event loop. This will take effect even if you're using the
8181

8282
.. code-block:: python
8383
84-
@pytest.yield_fixture()
84+
@pytest.fixture
8585
def event_loop():
8686
loop = MyCustomLoop()
8787
yield loop

pytest_asyncio/plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def pytest_runtest_setup(item):
166166
)
167167

168168

169-
@pytest.yield_fixture
169+
@pytest.fixture
170170
def event_loop(request):
171171
"""Create an instance of the default event loop for each test case."""
172172
loop = asyncio.get_event_loop_policy().new_event_loop()

tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
collect_ignore.append("async_fixtures/test_nested_36.py")
1010

1111

12-
@pytest.yield_fixture()
12+
@pytest.fixture
1313
def dependent_fixture(event_loop):
1414
"""A fixture dependent on the event_loop fixture, doing some cleanup."""
1515
counter = 0

tests/multiloop/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class CustomSelectorLoop(asyncio.SelectorEventLoop):
88
pass
99

1010

11-
@pytest.yield_fixture()
11+
@pytest.fixture
1212
def event_loop():
1313
"""Create an instance of the default event loop for each test case."""
1414
loop = CustomSelectorLoop()

0 commit comments

Comments
 (0)