Debian Codegraph @

tests/test_coverup_106.py

raw symbols SCIP
1 # file scalene/scalene_profiler.py:282-288
2 # lines [282, 283, 288]
3 # branches []
4
5 import pytest
6 import signal
7 from scalene.scalene_profiler import Scalene
8
9
10 @pytest.fixture(scope="function")
11 def cleanup_signals():
12 # Store the original signal state
13 original_signals = Scalene.get_timer_signals()
14 yield
15 # Restore the original signal state after the test
16 signal.signal(original_signals[0], signal.SIG_IGN)
17
18
19 def test_get_timer_signals(cleanup_signals):
20 # Set a timer signal to test
21 signal.signal(signal.SIGVTALRM, signal.SIG_IGN)
22 # Call the method to test
23 timer_signals = Scalene.get_timer_signals()
24 # Check if the signal.SIGVTALRM is in the returned tuple
25 assert signal.SIGVTALRM in timer_signals
26 # Check if the returned tuple only contains timer signals
27 assert isinstance(timer_signals[0], int)
28 assert isinstance(timer_signals[1], signal.Signals)