def test_choice(sb_mock): atm = ATM() atm.choice(1) sb_mock.assert_called_once() with pytest.raises(InvalidChoice): assert atm.choice(99)