Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-12-29 17:56:30 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2019-12-30 11:22:56 +0300
commitab184ac20d82d0546c21f33d2fdfbfb324078d56 (patch)
tree225b6c5f9904d8699332add3cb0939fb8be68ef2 /sphinx/testing
parent7a4bbf372a470700a1dfd96dd57054bb96b92fd3 (diff)
mypy: Enable disallow_incomplete_defs flag for type checking
Diffstat (limited to 'sphinx/testing')
-rw-r--r--sphinx/testing/path.py8
-rw-r--r--sphinx/testing/util.py6
2 files changed, 7 insertions, 7 deletions
diff --git a/sphinx/testing/path.py b/sphinx/testing/path.py
index d2fc4f31e..be3c74b37 100644
--- a/sphinx/testing/path.py
+++ b/sphinx/testing/path.py
@@ -124,17 +124,17 @@ class path(str):
def utime(self, arg: Any) -> None:
os.utime(self, arg)
- def open(self, mode: str = 'r', **kwargs) -> IO:
+ def open(self, mode: str = 'r', **kwargs: Any) -> IO:
return open(self, mode, **kwargs)
- def write_text(self, text: str, encoding: str = 'utf-8', **kwargs) -> None:
+ def write_text(self, text: str, encoding: str = 'utf-8', **kwargs: Any) -> None:
"""
Writes the given `text` to the file.
"""
with open(self, 'w', encoding=encoding, **kwargs) as f:
f.write(text)
- def text(self, encoding: str = 'utf-8', **kwargs) -> str:
+ def text(self, encoding: str = 'utf-8', **kwargs: Any) -> str:
"""
Returns the text in the file.
"""
@@ -181,7 +181,7 @@ class path(str):
"""
os.makedirs(self, mode, exist_ok=exist_ok)
- def joinpath(self, *args) -> "path":
+ def joinpath(self, *args: Any) -> "path":
"""
Joins the path with the argument given and returns the result.
"""
diff --git a/sphinx/testing/util.py b/sphinx/testing/util.py
index 1ba3237c4..a031b2ad2 100644
--- a/sphinx/testing/util.py
+++ b/sphinx/testing/util.py
@@ -47,7 +47,7 @@ def assert_startswith(thing: str, prefix: str) -> None:
assert False, '%r does not start with %r' % (thing, prefix)
-def assert_node(node: nodes.Node, cls: Any = None, xpath: str = "", **kwargs) -> None:
+def assert_node(node: nodes.Node, cls: Any = None, xpath: str = "", **kwargs: Any) -> None:
if cls:
if isinstance(cls, list):
assert_node(node, cls[0], xpath=xpath, **kwargs)
@@ -92,7 +92,7 @@ def etree_parse(path: str) -> Any:
class Struct:
- def __init__(self, **kwds) -> None:
+ def __init__(self, **kwds: Any) -> None:
self.__dict__.update(kwds)
@@ -165,7 +165,7 @@ class SphinxTestAppWrapperForSkipBuilding:
def __getattr__(self, name: str) -> Any:
return getattr(self.app, name)
- def build(self, *args, **kw) -> None:
+ def build(self, *args: Any, **kw: Any) -> None:
if not self.app.outdir.listdir(): # type: ignore
# if listdir is empty, do build.
self.app.build(*args, **kw)