summaryrefslogtreecommitdiff
path: root/tests/test_config.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-07-31 19:47:15 +0200
committerGeorg Brandl <georg@python.org>2010-07-31 19:47:15 +0200
commit0e84c758229f0a71a52b33c5e19d2e0b7d8b0ef1 (patch)
treefe7801c945fec5ded68d329b4aa2b3bd7eabb0bc /tests/test_config.py
parent86cd745dc1f5338804fa5adf24447a9427c09fb8 (diff)
downloadsphinx-git-0e84c758229f0a71a52b33c5e19d2e0b7d8b0ef1.tar.gz
Improve support for automatic 2to3 conversion of config files. It now kicks in whenever the original file raises SyntaxErrors on compiling.
Diffstat (limited to 'tests/test_config.py')
-rw-r--r--tests/test_config.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py
index ecf90f609..7fce4495b 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -88,6 +88,12 @@ def test_errors_warnings(dir):
write_file(dir / 'conf.py', u'project = \n', 'ascii')
raises_msg(ConfigError, 'conf.py', Config, dir, 'conf.py', {}, None)
+ # test the automatic conversion of 2.x only code in configs
+ write_file(dir / 'conf.py', u'\n\nproject = u"Jägermeister"\n', 'utf-8')
+ cfg = Config(dir, 'conf.py', {}, None)
+ cfg.init_values()
+ assert cfg.project == u'Jägermeister'
+
# test the warning for bytestrings with non-ascii content
# bytestrings with non-ascii content are a syntax error in python3 so we
# skip the test there