Skip to content

Commit

Permalink
skip new test on windows (needs cysignals.alarm)
Browse files Browse the repository at this point in the history
  • Loading branch information
tornaria authored and dimpase committed Jan 14, 2025
1 parent db7ad33 commit ad3ecea
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tests/test_custom_signals.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
import pytest
"""
Tests for custom signals.
"""

import time
import pytest

def test_clear_pending():
"""
Regression test for https://github.com/sagemath/cysignals/pull/216
"""

from cysignals.alarm import alarm, AlarmInterrupt

alarm = pytest.importorskip("cysignals.alarm") # n/a on windows
cypari2 = pytest.importorskip("cypari2")

with pytest.raises(AlarmInterrupt):
alarm(0.5)
with pytest.raises(alarm.AlarmInterrupt):
alarm.alarm(0.01)
time.sleep(1)

try:
cypari2.Pari()
except AlarmInterrupt:
except alarm.AlarmInterrupt:
pytest.fail("AlarmInterrupt was not cleared")

0 comments on commit ad3ecea

Please sign in to comment.