From 8a09d3cd45a5a5eb2be7be987d753e5be9d687ca Mon Sep 17 00:00:00 2001 From: Jane Liu Date: Wed, 10 Jul 2024 12:13:12 -0700 Subject: [PATCH] Added asserts to check session_timer.ip.ask_exit and session_timer.ip.pt_app.app.exit are called. --- hutch_python/tests/test_ipython_session_timer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hutch_python/tests/test_ipython_session_timer.py b/hutch_python/tests/test_ipython_session_timer.py index 7478481a..3720078b 100644 --- a/hutch_python/tests/test_ipython_session_timer.py +++ b/hutch_python/tests/test_ipython_session_timer.py @@ -10,7 +10,6 @@ @pytest.fixture(scope='function') def fake_ipython(): fake_ipython = FakeIPython() - fake_ipython.ask_exit = lambda *args, **kwargs: None return fake_ipython @@ -49,3 +48,5 @@ def test_start_session(session_timer, fake_ipython, capsys): captured = capsys.readouterr() assert "timed out" in captured.out + assert session_timer.ip.ask_exit.called + assert session_timer.ip.pt_app.app.exit.called