From 9ff16979390a789aefd1585a7c97d80c51c17207 Mon Sep 17 00:00:00 2001 From: Raymond Sun Date: Mon, 14 Jun 2021 16:02:28 +1000 Subject: [PATCH] Make test more readable --- tests/test_quickstart.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_quickstart.py b/tests/test_quickstart.py index 86c9cc6da..02140cf02 100644 --- a/tests/test_quickstart.py +++ b/tests/test_quickstart.py @@ -253,13 +253,16 @@ def test_extensions(tempdir): assert ns['extensions'] == ['foo', 'bar', 'baz'] -def test_exits_upon_existing_confpy(monkeypatch): - # The code detects existing conf.py with isfile() so we mock it +def test_exits_when_existing_confpy(monkeypatch): + # The code detects existing conf.py with path.isfile() + # so we mock it as True with pytest's monkeypatch def mock_isfile(path): return True monkeypatch.setattr(path, 'isfile', mock_isfile) - qs.term_input = mock_input({}) + qs.term_input = mock_input({ + 'Please enter a new root path (or just Enter to exit)': '' + }) d = {} with pytest.raises(SystemExit): qs.ask_user(d)