summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAdam Turner <9087854+aa-turner@users.noreply.github.com>2022-05-28 19:26:13 +0100
committerAdam Turner <9087854+aa-turner@users.noreply.github.com>2022-05-28 19:55:30 +0100
commit200414982c768c213ca66f41fa331a5b4d129d94 (patch)
tree3ac6e6701bcdda366f7beccfabcdaecc19443346 /tests
parent78c478a579b9d3f57091544d1717ee7f1c507ff1 (diff)
downloadsphinx-git-200414982c768c213ca66f41fa331a5b4d129d94.tar.gz
Update test
Diffstat (limited to 'tests')
-rw-r--r--tests/test_config.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_config.py b/tests/test_config.py
index ec8194af1..c0b8864e0 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -397,7 +397,8 @@ def test_conf_py_language_none(tempdir):
assert cfg.language == "en"
-def test_conf_py_language_none_warning(tempdir, caplog):
+@mock.patch("sphinx.config.logger")
+def test_conf_py_language_none_warning(logger, tempdir):
"""Regression test for #10474."""
# Given a conf.py file with language = None
@@ -407,12 +408,11 @@ def test_conf_py_language_none_warning(tempdir, caplog):
Config.read(tempdir, {}, None)
# Then a warning is raised
- assert len(caplog.messages) == 1
- assert caplog.messages[0] == (
+ assert logger.warning.called
+ assert logger.warning.call_args[0][0] == (
"Invalid configuration value found: 'language = None'. "
"Update your configuration to a valid langauge code. "
"Falling back to 'en' (English).")
- assert caplog.records[0].levelname == "WARNING"
def test_conf_py_no_language(tempdir):