Skip to content

Commit

Permalink
More accurate windows test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dfangl committed Feb 3, 2025
1 parent f83078c commit cacdc12
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/jpypetest/test_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ def sigterm_handler(sig, frame):
jpype.startJVM(interrupt=False)

def setUp(self):
if sys.platform == "win32":
raise unittest.SkipTest("signals test not applicable on windows")
self.sigint_event.clear()
self.sigterm_event.clear()

def testSigInt(self):
os.kill(os.getpid(), signal.SIGINT)
if sys.platform == "win32":
os.kill(os.getpid(), signal.CTRL_C_EVENT)
else:
os.kill(os.getpid(), signal.SIGINT)

# the test is executed in the main thread. The signal cannot interrupt the threading.Event.wait() call
# so asserting the return value of `wait` does not work.
Expand All @@ -63,6 +64,8 @@ def testSigInt(self):
self.assertFalse(self.sigterm_event.is_set())

def testSigTerm(self):
if sys.platform == "win32":
raise unittest.SkipTest("SIGTERM test not applicable on windows")
os.kill(os.getpid(), signal.SIGTERM)

self.sigterm_event.wait(0.1)
Expand Down

0 comments on commit cacdc12

Please sign in to comment.