mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix the valid types check for `Any in sphinx.config`
This commit is contained in:
@@ -5,7 +5,7 @@ import pickle
|
||||
import time
|
||||
from collections import Counter
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, Any
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
@@ -552,6 +552,14 @@ def test_check_enum_for_list_failed(logger):
|
||||
assert logger.warning.called
|
||||
|
||||
|
||||
@mock.patch("sphinx.config.logger")
|
||||
def test_check_any(logger):
|
||||
config = Config({'value': None})
|
||||
config.add('value', 'default', '', Any)
|
||||
check_confval_types(None, config)
|
||||
logger.warning.assert_not_called() # not warned
|
||||
|
||||
|
||||
nitpick_warnings = [
|
||||
"WARNING: py:const reference target not found: prefix.anything.postfix",
|
||||
"WARNING: py:class reference target not found: prefix.anything",
|
||||
|
||||
Reference in New Issue
Block a user