mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Make test more readable
This commit is contained in:
parent
6a9cc9e5ea
commit
9ff1697939
@ -253,13 +253,16 @@ def test_extensions(tempdir):
|
|||||||
assert ns['extensions'] == ['foo', 'bar', 'baz']
|
assert ns['extensions'] == ['foo', 'bar', 'baz']
|
||||||
|
|
||||||
|
|
||||||
def test_exits_upon_existing_confpy(monkeypatch):
|
def test_exits_when_existing_confpy(monkeypatch):
|
||||||
# The code detects existing conf.py with isfile() so we mock it
|
# The code detects existing conf.py with path.isfile()
|
||||||
|
# so we mock it as True with pytest's monkeypatch
|
||||||
def mock_isfile(path):
|
def mock_isfile(path):
|
||||||
return True
|
return True
|
||||||
monkeypatch.setattr(path, 'isfile', mock_isfile)
|
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 = {}
|
d = {}
|
||||||
with pytest.raises(SystemExit):
|
with pytest.raises(SystemExit):
|
||||||
qs.ask_user(d)
|
qs.ask_user(d)
|
||||||
|
Loading…
Reference in New Issue
Block a user