We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a488312 commit b12a248Copy full SHA for b12a248
pytest_twisted.py
@@ -200,7 +200,16 @@ def init_twisted_greenlet():
200
return
201
202
if not _instances.reactor.running:
203
- if signal.getsignal(signal.SIGINT) == signal.default_int_handler:
+ if not isinstance(threading.current_thread(), threading._MainThread):
204
+ warnings.warn(
205
+ (
206
+ 'Failed to block Twisted signal configuration due to not running in the main thread.'
207
+ ' See https://github.com/pytest-dev/pytest-twisted/issues/153.'
208
+
209
+ ),
210
+ RuntimeWarning,
211
+ )
212
+ elif signal.getsignal(signal.SIGINT) == signal.default_int_handler:
213
signal.signal(
214
signal.SIGINT,
215
functools.partial(signal.default_int_handler),
0 commit comments