File tree 2 files changed +10
-0
lines changed 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ generator fixtures.
21
21
Changelog
22
22
---------
23
23
24
+ 0.5.5 - TBD
25
+ * Fix bug where it was possible for an async generator fixture to
26
+ be cleaned up even if it was never started.
27
+
24
28
0.5.4 - 26 January 2021
25
29
* Added a ``--default-async-timeout `` option from the CLI. With many thanks
26
30
to @andredias.
Original file line number Diff line number Diff line change @@ -189,6 +189,10 @@ def finalizer():
189
189
"""Yield again, to finalize."""
190
190
__tracebackhide__ = True
191
191
192
+ nonlocal info
193
+ if "ran_once" not in info :
194
+ return
195
+
192
196
info = {"gen_obj" : gen_obj , "finalizer" : True }
193
197
194
198
async def async_finalizer ():
@@ -242,3 +246,5 @@ def timeout_task(task):
242
246
exc_info = sys .exc_info ()
243
247
e = exc_info [1 ]
244
248
info ["e" ] = e
249
+ finally :
250
+ info ["ran_once" ] = True
You can’t perform that action at this time.
0 commit comments