Skip to content

Commit

Permalink
Merge pull request #83 from pehala/term_handler
Browse files Browse the repository at this point in the history
Add term_handler
  • Loading branch information
pehala authored Sep 8, 2022
2 parents 128d96d + f8d161c commit 245c4e6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions testsuite/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Root conftest"""
import signal

from urllib.parse import urlparse

import pytest
Expand All @@ -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"""
Expand Down

0 comments on commit 245c4e6

Please sign in to comment.