We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 64d7498 commit 86403f0Copy full SHA for 86403f0
pytest_twisted.py
@@ -22,6 +22,14 @@ def from_mark(cls, mark):
22
)
23
24
25
+class AsyncGeneratorFixtureDidNotStopError(Exception):
26
+ @classmethod
27
+ def from_generator(cls, generator):
28
+ return cls(
29
+ 'async fixture did not stop: {}'.format(generator),
30
+ )
31
+
32
33
class _config:
34
external_reactor = False
35
@@ -172,8 +180,8 @@ def _pytest_pyfunc_call(pyfuncitem):
172
180
except StopAsyncIteration:
173
181
continue
174
182
else:
175
- raise RuntimeError(
176
- 'async fixture did not stop: {}'.format(arg),
183
+ raise AsyncGeneratorFixtureDidNotStopError.from_generator(
184
+ generator=arg,
177
185
178
186
179
187
defer.returnValue(result)
0 commit comments