Skip to content

Commit

Permalink
Simplify unnecessary raise_signal util function
Browse files Browse the repository at this point in the history
  • Loading branch information
raulcd committed Sep 16, 2024
1 parent 0bc40f3 commit 66bd33e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
5 changes: 1 addition & 4 deletions python/pyarrow/tests/test_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions python/pyarrow/tests/test_flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 0 additions & 4 deletions python/pyarrow/tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 66bd33e

Please sign in to comment.