We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ec9287 commit 633c988Copy full SHA for 633c988
README.rst
@@ -130,6 +130,21 @@ to redefine the ``event_loop`` fixture to have the same or broader scope.
130
Async fixtures need the event loop, and so must have the same or narrower scope
131
than the ``event_loop`` fixture.
132
133
+Python 3.5 lacks support for async generators. If you really need support for
134
+Python 3.5, you can still mimic a tear down using pytest's finalizers. Notice
135
+that the event loop is not running inside finalizers:
136
+
137
+.. code-block:: python
138
139
+ @pytest.fixture
140
+ async def async_fixture(request, event_loop):
141
+ def fin():
142
+ async def afin():
143
+ await some_teardown()
144
+ event_loop.run_until_complete(afin())
145
+ request.addfinalizer(fin)
146
+ return 'a value'
147
148
Markers
149
-------
150
0 commit comments