From 20a1775c833a4ff355b7401bfab3f0ce02f0babb Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Fri, 27 May 2022 23:50:07 +0100 Subject: [PATCH] Add test --- tests/test_config.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index 3d72a6b0f..dea741820 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -381,3 +381,17 @@ def test_nitpick_ignore_regex_fullmatch(app, status, warning): assert len(warning) == len(nitpick_warnings) for actual, expected in zip(warning, nitpick_warnings): assert expected in actual + + +def test_conf_py_language_none(tempdir): + """Regression test for #10474.""" + + # Given a conf.py file with language = None + (tempdir / 'conf.py').write_text("language = None", encoding='utf-8') + + # When we load conf.py into a Config object + cfg = Config.read(tempdir, {}, None) + cfg.init_values() + + # Then the language is coerced to English + assert cfg.language == "en"