mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Update test
This commit is contained in:
parent
78c478a579
commit
200414982c
@ -3,7 +3,6 @@
|
||||
import re
|
||||
import traceback
|
||||
import types
|
||||
import warnings
|
||||
from collections import OrderedDict
|
||||
from os import getenv, path
|
||||
from typing import (TYPE_CHECKING, Any, Callable, Dict, Generator, Iterator, List, NamedTuple,
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user