Commit 8e4f2444 authored by Tim Schoof's avatar Tim Schoof
Browse files

Use type "Any" in docstrings if type is not given

When Config and attr.ib parameters are mixed and an attr.ib has neither
a type nor a description, the docstring looks better with this change.
parent 7ed5e310
Pipeline #30830 passed with stage
in 54 seconds
......@@ -72,7 +72,7 @@ def Configurable(maybe_cls=None, *args, **kwargs):
doc = ""
for field in config_entries(cls):
if field.type is None:
typename = ""
typename = "Any"
else:
typename = field.type.__name__
......
......@@ -10,7 +10,7 @@ def test_create_docstring():
assert Foo.__doc__ == (
"Foo\n\nwith_type: int\n An int parameter\n"
"without_type: \n A parameter without type")
"without_type: Any\n A parameter without type")
def test_extend_docstring():
......@@ -23,7 +23,7 @@ def test_extend_docstring():
assert Foo.__doc__ == (
"A single line description of Foo\n\n"
"with_type: int\n An int parameter\n"
"without_type: \n A parameter without type")
"without_type: Any\n A parameter without type")
def test_not_extend_docstring():
......@@ -63,7 +63,7 @@ def test_insert_docstring():
" Some more details.\n\n"
" with_type: int\n"
" An int parameter\n"
"without_type: \n"
"without_type: Any\n"
" A parameter without type\n\n"
" Some closing remarks.")
......@@ -77,7 +77,7 @@ def test_docstring_init_false():
assert Test.__doc__ == (
"Test\n"
"\n"
"do_init: \n"
"do_init: Any\n"
" Init me")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment