Skip to content

Commit b59e7a6

Browse files
committed
also reset alarm in test_toy_build_lock
1 parent 144c28e commit b59e7a6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/framework/toy_build.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2744,7 +2744,7 @@ def test_toy_build_lock(self):
27442744
self.test_toy_build(extra_args=extra_args + ['--ignore-locks'], verify=True, raise_error=True)
27452745

27462746
# define a context manager that remove a lock after a while, so we can check the use of --wait-for-lock
2747-
class remove_lock_after:
2747+
class remove_lock_after(object):
27482748
def __init__(self, seconds, lock_fp):
27492749
self.seconds = seconds
27502750
self.lock_fp = lock_fp
@@ -2757,7 +2757,8 @@ def __enter__(self):
27572757
signal.alarm(self.seconds)
27582758

27592759
def __exit__(self, type, value, traceback):
2760-
pass
2760+
# cancel scheduled alarm (just for cleanup sake)
2761+
signal.alarm(0)
27612762

27622763
# wait for lock to be removed, with 1 second interval of checking;
27632764
# check with both --wait-on-lock-interval and deprecated --wait-on-lock options
@@ -2854,7 +2855,7 @@ def test_toy_lock_cleanup_signals(self):
28542855
self.assertFalse(os.path.exists(locks_dir))
28552856

28562857
# context manager which stops the function being called with the specified signal
2857-
class wait_and_signal:
2858+
class wait_and_signal(object):
28582859
def __init__(self, seconds, signum):
28592860
self.seconds = seconds
28602861
self.signum = signum

0 commit comments

Comments
 (0)