Skip to content

Commit 527c1a4

Browse files
committed
Replaced assert_called_once since it is not defined in older Mock lib versions.
1 parent 257ee74 commit 527c1a4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/test_timer.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def test_timer_simple():
2121

2222
avr.step(1000)
2323
eq_(avr.state, cpu_Running, "mcu is not running")
24-
25-
callbackMock.assert_called_once()
24+
25+
eq_(callbackMock.call_count, 1, "number of calback invocations")
2626
avr.terminate()
2727

2828
def test_timer_reoccuring():
@@ -42,7 +42,6 @@ def test_timer_reoccuring():
4242
# Run long enought to ensure callback is canceled by returning 0 on the second invocation.
4343
avr.step(1000)
4444
eq_(avr.state, cpu_Running, "mcu is not running")
45-
callbackMock.assert_called()
4645
eq_(callbackMock.call_count, 2, "number of calback invocations")
4746

4847
lastCallFirstArg = callbackMock.call_args[0][0]

0 commit comments

Comments
 (0)