Skip to content

Commit ad4b617

Browse files
tests fixed
1 parent 8bef5e3 commit ad4b617

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

tests/test_deep_simulation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ def test_01_k2400_iv_backend(self):
9999

100100
with patch('pymeasure.instruments.keithley.Keithley2400') as MockInst:
101101
spy = MockInst.return_value
102-
with patch('builtins.input', side_effect=['100', '10', 'test_file']), \
102+
# The script now uses argparse, so we patch sys.argv
103+
test_args = ['-m', '--filename', 'test_file', '--range', '100', '--step', '10']
104+
with patch('sys.argv', test_args), \
103105
patch('pandas.DataFrame.to_csv'):
104106
self.run_module_safely(
105107
"Keithley_2400.Instrument_Control.IV_K2400_Loop_Instrument_Control_v10", {})

tests/test_full_stack_simulation.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ def test_keithley2400_iv_protocol(self):
5555
spy_inst = MockK2400.return_value
5656
spy_inst.voltage = 1.23
5757

58-
# Inputs: Current=100uA, Step=10uA, File=test_output
59-
fake_inputs = ['100', '10', 'test_output']
58+
# The script now uses argparse, so we patch sys.argv
59+
# Corresponds to: Current=100uA, Step=10uA, File=test_output
60+
test_args = ['-m', '--filename', 'test_output', '--range', '100', '--step', '10']
6061

61-
with patch('builtins.input', side_effect=fake_inputs), \
62+
with patch('sys.argv', test_args), \
6263
patch('pandas.DataFrame.to_csv'):
6364
self.run_module_safely(
6465
"Keithley_2400.Instrument_Control.IV_K2400_Loop_Instrument_Control_v10")

0 commit comments

Comments
 (0)