diff --git a/testsuite/tests/conftest.py b/testsuite/tests/conftest.py index 360e9f08..37d51c1b 100644 --- a/testsuite/tests/conftest.py +++ b/testsuite/tests/conftest.py @@ -1,4 +1,6 @@ """Root conftest""" +import signal + from urllib.parse import urlparse import pytest @@ -13,6 +15,17 @@ from testsuite.utils import randomize, _whoami +@pytest.fixture(scope='session', autouse=True) +def term_handler(): + """ + This will handle ^C, cleanup won't be skipped + https://github.com/pytest-dev/pytest/issues/9142 + """ + orig = signal.signal(signal.SIGTERM, signal.getsignal(signal.SIGINT)) + yield + signal.signal(signal.SIGTERM, orig) + + @pytest.fixture(scope="session") def testconfig(): """Testsuite settings"""