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 5c4dde0 commit 02111fbCopy full SHA for 02111fb
pytest_timeout.py
@@ -16,7 +16,7 @@
16
import traceback
17
from collections import namedtuple
18
from distutils.version import LooseVersion
19
-from threading import current_thread
+from threading import current_thread, main_thread
20
from _pytest.config import ExitCode
21
from _pytest.outcomes import Failed
22
@@ -198,6 +198,10 @@ def timeout_setup(item):
198
params = get_params(item)
199
if params.timeout is None or params.timeout <= 0:
200
return
201
+
202
+ if params.method == "signal" and not (current_thread() is main_thread()):
203
+ params.method = "thread"
204
205
if params.method == "signal":
206
207
def handler(signum, frame):
0 commit comments