Skip to content

Commit 245c4e6

Browse files
authored
Merge pull request #83 from pehala/term_handler
Add term_handler
2 parents 128d96d + f8d161c commit 245c4e6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

testsuite/tests/conftest.py

+13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
"""Root conftest"""
2+
import signal
3+
24
from urllib.parse import urlparse
35

46
import pytest
@@ -13,6 +15,17 @@
1315
from testsuite.utils import randomize, _whoami
1416

1517

18+
@pytest.fixture(scope='session', autouse=True)
19+
def term_handler():
20+
"""
21+
This will handle ^C, cleanup won't be skipped
22+
https://github.com/pytest-dev/pytest/issues/9142
23+
"""
24+
orig = signal.signal(signal.SIGTERM, signal.getsignal(signal.SIGINT))
25+
yield
26+
signal.signal(signal.SIGTERM, orig)
27+
28+
1629
@pytest.fixture(scope="session")
1730
def testconfig():
1831
"""Testsuite settings"""

0 commit comments

Comments
 (0)