From 66bd33eaeb4572faeee33ccb0acc0887247fa7ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Mon, 16 Sep 2024 10:56:15 +0200 Subject: [PATCH] Simplify unnecessary raise_signal util function --- python/pyarrow/tests/test_csv.py | 5 +---- python/pyarrow/tests/test_flight.py | 4 +--- python/pyarrow/tests/util.py | 4 ---- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/python/pyarrow/tests/test_csv.py b/python/pyarrow/tests/test_csv.py index dcf96f68c4da7..c45a590bf287c 100644 --- a/python/pyarrow/tests/test_csv.py +++ b/python/pyarrow/tests/test_csv.py @@ -1444,14 +1444,11 @@ def test_cancellation(self): if (threading.current_thread().ident != threading.main_thread().ident): pytest.skip("test only works from main Python thread") - # Skips test if not available - raise_signal = util.get_raise_signal() - signum = signal.SIGINT def signal_from_thread(): # Give our workload a chance to start up time.sleep(0.2) - raise_signal(signum) + signal.raise_signal(signal.SIGINT) # We start with a small CSV reading workload and increase its size # until it's large enough to get an interruption during it, even in diff --git a/python/pyarrow/tests/test_flight.py b/python/pyarrow/tests/test_flight.py index 029a2695b9fd8..f0ceba37d6933 100644 --- a/python/pyarrow/tests/test_flight.py +++ b/python/pyarrow/tests/test_flight.py @@ -2101,12 +2101,10 @@ def do_exchange(self, context, descriptor, reader, writer): def test_interrupt(): if threading.current_thread().ident != threading.main_thread().ident: pytest.skip("test only works from main Python thread") - # Skips test if not available - raise_signal = util.get_raise_signal() def signal_from_thread(): time.sleep(0.5) - raise_signal(signal.SIGINT) + signal.raise_signal(signal.SIGINT) exc_types = (KeyboardInterrupt, pa.ArrowCancelled) diff --git a/python/pyarrow/tests/util.py b/python/pyarrow/tests/util.py index 558d9a621c23e..acbb2a5c0de6f 100644 --- a/python/pyarrow/tests/util.py +++ b/python/pyarrow/tests/util.py @@ -309,10 +309,6 @@ def open_append_stream(self, path, metadata): return self._fs.open_append_stream(path, metadata=metadata) -def get_raise_signal(): - return signal.raise_signal - - @contextlib.contextmanager def signal_wakeup_fd(*, warn_on_full_buffer=False): # Use a socket pair, rather a self-pipe, so that select() can be used