summaryrefslogtreecommitdiff
path: root/tests/test_quickstart.py
diff options
context:
space:
mode:
authorTakayuki Shimizukawa <shimizukawa@gmail.com>2013-02-10 15:25:45 +0900
committerTakayuki Shimizukawa <shimizukawa@gmail.com>2013-02-10 15:25:45 +0900
commit05718e4a1a7d385ea45a8b4d503a8099b6731e31 (patch)
tree0cddde06dd0410a72f5ed7ae3da6d52dfbc403b6 /tests/test_quickstart.py
parent57a84ff442b3e42a4c00fab664ca7570a2791517 (diff)
downloadsphinx-git-05718e4a1a7d385ea45a8b4d503a8099b6731e31.tar.gz
conf.py now accept CRLF end-of-line.
Diffstat (limited to 'tests/test_quickstart.py')
-rw-r--r--tests/test_quickstart.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/tests/test_quickstart.py b/tests/test_quickstart.py
index ff1f75684..69839da9e 100644
--- a/tests/test_quickstart.py
+++ b/tests/test_quickstart.py
@@ -16,6 +16,7 @@ from util import *
from sphinx import quickstart as qs
from sphinx.util.console import nocolor, coloron
+from sphinx.util.pycompat import execfile_
def setup_module():
nocolor()
@@ -110,12 +111,7 @@ def test_quickstart_defaults(tempdir):
conffile = tempdir / 'conf.py'
assert conffile.isfile()
ns = {}
- f = open(conffile, 'rbU')
- try:
- code = compile(f.read(), conffile, 'exec')
- finally:
- f.close()
- exec code in ns
+ execfile_(conffile, ns)
assert ns['extensions'] == []
assert ns['templates_path'] == ['_templates']
assert ns['source_suffix'] == '.rst'
@@ -170,12 +166,7 @@ def test_quickstart_all_answers(tempdir):
conffile = tempdir / 'source' / 'conf.py'
assert conffile.isfile()
ns = {}
- f = open(conffile, 'rbU')
- try:
- code = compile(f.read(), conffile, 'exec')
- finally:
- f.close()
- exec code in ns
+ execfile_(conffile, ns)
assert ns['extensions'] == ['sphinx.ext.autodoc', 'sphinx.ext.doctest']
assert ns['templates_path'] == ['.templates']
assert ns['source_suffix'] == '.txt'