summaryrefslogtreecommitdiff
path: root/tests/test_quickstart.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-17 18:38:14 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-17 18:39:27 +0900
commit9ced1e355ad6baecd4e755a598a54877dc0aad44 (patch)
treee7d8d429a49fb26b221147f97a2b410b3faf4a0e /tests/test_quickstart.py
parent30f8640bab786b28e2fbc3a12a4cf212e6f953d1 (diff)
downloadsphinx-git-9ced1e355ad6baecd4e755a598a54877dc0aad44.tar.gz
refactor: test: Do not use deprecated function: execfile_()
Diffstat (limited to 'tests/test_quickstart.py')
-rw-r--r--tests/test_quickstart.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/test_quickstart.py b/tests/test_quickstart.py
index 11086f5f6..02aafe335 100644
--- a/tests/test_quickstart.py
+++ b/tests/test_quickstart.py
@@ -16,7 +16,6 @@ import pytest
from sphinx import application
from sphinx.cmd import quickstart as qs
from sphinx.util.console import coloron, nocolor
-from sphinx.util.pycompat import execfile_
warnfile = StringIO()
@@ -108,7 +107,7 @@ def test_quickstart_defaults(tempdir):
conffile = tempdir / 'conf.py'
assert conffile.isfile()
ns = {}
- execfile_(conffile, ns)
+ exec(conffile.read_text(), ns)
assert ns['extensions'] == []
assert ns['templates_path'] == ['_templates']
assert ns['project'] == 'Sphinx Test'
@@ -158,7 +157,7 @@ def test_quickstart_all_answers(tempdir):
conffile = tempdir / 'source' / 'conf.py'
assert conffile.isfile()
ns = {}
- execfile_(conffile, ns)
+ exec(conffile.read_text(), ns)
assert ns['extensions'] == [
'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo'
]
@@ -239,7 +238,7 @@ def test_default_filename(tempdir):
conffile = tempdir / 'conf.py'
assert conffile.isfile()
ns = {}
- execfile_(conffile, ns)
+ exec(conffile.read_text(), ns)
def test_extensions(tempdir):
@@ -249,5 +248,5 @@ def test_extensions(tempdir):
conffile = tempdir / 'conf.py'
assert conffile.isfile()
ns = {}
- execfile_(conffile, ns)
+ exec(conffile.read_text(), ns)
assert ns['extensions'] == ['foo', 'bar', 'baz']