Skip to content

Commit 4c446a6

Browse files
Fix for test_deep_simulation.py
1 parent f66ba60 commit 4c446a6

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

Keithley_6517B/High_Resistance/Backends/IV_K6517B_Simple_Backend_v10.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def main():
106106
keithley.write(':SYSTem:ZCHeck ON') # type: ignore
107107
time.sleep(5)
108108
print("Step 2: Acquiring zero correction value...")
109-
# keithley.write(':SYSTem:ZCORrect:ACQuire')
109+
keithley.write(':SYSTem:ZCORrect:ACQuire')
110110
time.sleep(5)
111111
print("Step 3: Disabling Zero Check mode...")
112112
keithley.write(':SYSTem:ZCHeck OFF')

tests/test_deep_simulation.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ def setUp(self):
4545
def tearDown(self):
4646
print(f"[TEST END] {self._testMethodName}\n", flush=True)
4747

48+
# -------------------------------------------------------------------------
49+
# HELPER: The "Watchdog" Timer
50+
# -------------------------------------------------------------------------
51+
def _timeout_handler(self, signum, frame):
52+
raise TimeoutError(
53+
f"Test {self._testMethodName} took longer than 30s! Infinite Loop suspected.")
54+
4855
def run_module_safely(self, module_name):
4956
"""Imports and runs a module with a strict 30-second timeout."""
5057
# Set an alarm for 30 seconds (Works on Linux/GitHub Actions)

tests/test_fixes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class TestFixes(unittest.TestCase):
55

66
@patch('time.sleep', MagicMock()) # Add mock for time.sleep to isolate the test
77
@patch('builtins.input', side_effect=['10', '2', 'test_output'])
8-
@patch('pymeasure.instruments.keithley.Keithley2400')
8+
@patch('Keithley_2400.Backends.IV_K2400_Loop_Backend_v10.Keithley2400')
99
@patch('matplotlib.pyplot.show')
1010
@patch('pandas.DataFrame.to_csv')
1111
def test_iv_k2400_fix(self, mock_to_csv, mock_plt_show, mock_keithley_class, mock_input):

0 commit comments

Comments
 (0)