Undocumented
Class |
|
A system with only the attrs extension enabled. |
Class |
|
A system with only the twisted deprecated extension enabled. |
Class |
|
Undocumented |
Class |
|
A system with no extensions. |
Class |
|
A system with only the zope interface extension enabled. |
Function | ann |
Return the textual representation and line number of an object's type annotation. |
Function | from |
Undocumented |
Function | test |
Code inside of if __name__ == '__main__' should be skipped. |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
If no value in __all__ could be parsed, the result is an empty list. |
Function | test |
Values other than lists and tuples assigned to __all__ have no effect and a warning is logged. |
Function | test |
Currently, it does not mark instance members as constants, never. |
Function | test |
A class variable named __all__ is just an ordinary variable and does not affect Module.all. |
Function | test |
If there are multiple assignments to __all__, a warning is logged and the last assignment takes effect. |
Function | test |
Non-literals in __all__ are ignored. |
Function | test |
Non-string literals in __all__ are ignored. |
Function | test |
The value assigned to __all__ is parsed to Module.all. |
Function | test |
Undocumented |
Function | test |
An assignment to a method in a class body does not change the type of the documentable. |
Function | test |
An assignment to a method inside __init__() does not change the type of the documentable. |
Function | test |
Invalid string annotations must be reported as syntax errors. |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Class variables with all-uppercase names are recognized as constants. |
Function | test |
Module variables with all-uppercase names are recognized as constants. |
Function | test |
Module variables annotated with typing.Final are recognized as constants. |
Function | test |
It can recognize constants defined with typing.Final. It will infer the type of the constant if Final do not use subscripts. |
Function | test |
It can recognize constants defined with typing.Final[something] |
Function | test |
It can recognize constants defined with typing.Final[something]. And it automatically remove the Final part from the annotation. |
Function | test |
It warns if there is an invalid Final annotation. |
Function | test |
It warns if there is an invalid Final annotation. |
Function | test |
Module variables annotated with typing_extensions.Final are recognized as constants. |
Function | test |
Constant can be documented as variables at docstring level without any warnings. |
Function | test |
Undocumented |
Function | test |
It warns when a constant is beeing re defined in instance. But it ignores it's value. |
Function | test |
It warns when a constant is beeing re defined in instance. But it ignores it's value. Even if the actual constant definition is detected after the instance variable of the same name. |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
The value assigned to __docformat__ is parsed to Module.docformat. |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
We currently don't trace values for detupling assignments, so when assigning to __doc__ we get a warning about the unknown value. |
Function | test |
A variable that is documented should not be considered an alias. |
Function | test |
Exceptions are marked with the special kind "EXCEPTION". |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
When a function has an invalid signature, an error is logged and the empty signature is returned. |
Function | test |
A round trip from source to inspect.Signature and back produces the original text. |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Importing a function from a package should look in the __init__ module. |
Function | test |
Importing a module from a package should not look in __init__ module. |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Strings inside Literal annotations must not be recursively parsed. |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
The node2fullname() function finds the full (global) name for a name expression in the AST. |
Function | test |
Undocumented |
Function | test |
Option --prepend-package option relies simply on the ISystemBuilder interface, so we can test it by using addModuleString, but it's not exactly what happens when we actually run pydoctor. See the other test ... |
Function | test |
In this test, we closer mimics what happens in the driver when --prepend-package option is passed. |
Function | test |
Warn when a method is decorated as both property and class/staticmethod. These decoration combinations do not create class/static properties. |
Function | test |
Any custom decorator with a name ending in 'property' makes a method into a property getter. |
Function | test |
A function decorated with '@property' is documented as an attribute. |
Function | test |
Property setter and deleter methods are renamed, so they don't replace the property itself. |
Function | test |
If a target module, explicitly re-export via __all__ a set of names that were initially imported from a sub-module via a wildcard, those names are documented as part of the target module. |
Function | test |
Relative imports in a package must be resolved by going up one level less, since we don't count "__init__.py" as a level. |
Function | test |
A warning is logged when a relative import goes beyond the top-level package. |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Type aliases and type variables are recognized as such. |
Function | test |
Undocumented |
Function | test |
Annotations or parts thereof that are strings are parsed and line number information is preserved. |
Function | test |
Test for issue #474. |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | to |
Undocumented |
Function | type2html |
Undocumented |
Function | type2str |
Undocumented |
Function | unwrap |
Undocumented |
Variable | systemcls |
Undocumented |
Return the textual representation and line number of an object's type annotation.
Parameters | |
obj:model.Documentable | Documentable object with a type annotation. |
Returns | |
Tuple[ | Undocumented |
Undocumented
Parameters | |
text:str | Undocumented |
modname:str | Undocumented |
isbool | Undocumented |
parentOptional[ | Undocumented |
system:Optional[ | Undocumented |
systemcls:Type[ | Undocumented |
Returns | |
model.Module | Undocumented |
Code inside of if __name__ == '__main__' should be skipped.
Parameters | |
systemcls:Type[ | Undocumented |
If no value in __all__ could be parsed, the result is an empty list.
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
Values other than lists and tuples assigned to __all__ have no effect and a warning is logged.
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
def test_all_caps_variable_in_instance_is_not_a_constant(systemcls, capsys): (source) ¶
Currently, it does not mark instance members as constants, never.
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
A class variable named __all__ is just an ordinary variable and does not affect Module.all.
Parameters | |
systemcls:Type[ | Undocumented |
If there are multiple assignments to __all__, a warning is logged and the last assignment takes effect.
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
Non-literals in __all__ are ignored.
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
Non-string literals in __all__ are ignored.
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
The value assigned to __all__ is parsed to Module.all.
Parameters | |
systemcls:Type[ | Undocumented |
An assignment to a method in a class body does not change the type of the documentable.
If the name we assign to exists and it does not belong to an Attribute (it's a Function instead, in this test case), the assignment will be ignored.
Parameters | |
systemcls:Type[ | Undocumented |
An assignment to a method inside __init__() does not change the type of the documentable.
If the name we assign to exists and it does not belong to an Attribute (it's a Function instead, in this test case), the assignment will be ignored.
Parameters | |
systemcls:Type[ | Undocumented |
@systemcls_param
def test_bad_string_annotation(annotation, systemcls, capsys): (source) ¶
Invalid string annotations must be reported as syntax errors.
Parameters | |
annotation:str | Undocumented |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
Class variables with all-uppercase names are recognized as constants.
Parameters | |
systemcls:Type[ | Undocumented |
Module variables with all-uppercase names are recognized as constants.
Parameters | |
systemcls:Type[ | Undocumented |
Module variables annotated with typing.Final are recognized as constants.
Parameters | |
systemcls:Type[ | Undocumented |
It can recognize constants defined with typing.Final. It will infer the type of the constant if Final do not use subscripts.
Parameters | |
systemcls:Type[ | Undocumented |
It can recognize constants defined with typing.Final[something]
Parameters | |
systemcls:Type[ | Undocumented |
It can recognize constants defined with typing.Final[something]. And it automatically remove the Final part from the annotation.
Parameters | |
systemcls:Type[ | Undocumented |
def test_constant_module_with_final_subscript_invalid_warns(systemcls, capsys): (source) ¶
It warns if there is an invalid Final annotation.
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
def test_constant_module_with_final_subscript_invalid_warns2(systemcls, capsys): (source) ¶
It warns if there is an invalid Final annotation.
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
Module variables annotated with typing_extensions.Final are recognized as constants.
Parameters | |
systemcls:Type[ | Undocumented |
def test_constant_override_do_not_warns_when_defined_in_class_docstring(systemcls, capsys): (source) ¶
Constant can be documented as variables at docstring level without any warnings.
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
def test_constant_override_do_not_warns_when_defined_in_module_docstring(systemcls, capsys): (source) ¶
Undocumented
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
It warns when a constant is beeing re defined in instance. But it ignores it's value.
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
It warns when a constant is beeing re defined in instance. But it ignores it's value. Even if the actual constant definition is detected after the instance variable of the same name.
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
The value assigned to __docformat__ is parsed to Module.docformat.
Parameters | |
systemcls:Type[ | Undocumented |
We currently don't trace values for detupling assignments, so when assigning to __doc__ we get a warning about the unknown value.
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
A variable that is documented should not be considered an alias.
Parameters | |
systemcls:Type[ | Undocumented |
Exceptions are marked with the special kind "EXCEPTION".
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
@systemcls_param
def test_function_badsig(signature, systemcls, capsys): (source) ¶
When a function has an invalid signature, an error is logged and the empty signature is returned.
Note that most bad signatures lead to a SyntaxError, which we cannot recover from. This test checks what happens if the AST can be produced but inspect.Signature() rejects the parsed parameters.
Parameters | |
signature:str | Undocumented |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
@systemcls_param
def test_function_signature(signature, systemcls): (source) ¶
A round trip from source to inspect.Signature and back produces the original text.
Parameters | |
signature:str | Undocumented |
systemcls:Type[ | Undocumented |
Note | |
Our inspect.Signature Paramters objects are now tweaked such that they might produce HTML tags, handled by the PyvalColorizer . |
@pytest.mark.parametrize(
@systemcls_param
def test_function_signature_posonly(signature, systemcls): (source) ¶
Undocumented
Parameters | |
signature:str | Undocumented |
systemcls:Type[ | Undocumented |
Importing a function from a package should look in the __init__ module.
In this test the following hierarchy is constructed:
package a module __init__ defines function 'f' module c imports function 'f' module b imports function 'f'
We verify that when module b and c import the name f from package a, they import the function f from the module a.__init__.
Parameters | |
systemcls:Type[ | Undocumented |
Importing a module from a package should not look in __init__ module.
In this test the following hierarchy is constructed:
package a module __init__ module b defines function 'f' module c imports module 'a.b'
We verify that when module c imports the name b from package a, it imports the module a.b which contains f.
Parameters | |
systemcls:Type[ | Undocumented |
def test_literal_string_annotation(annotation, expected): (source) ¶
Option --prepend-package option relies simply on the ISystemBuilder
interface, so we can test it by using addModuleString, but it's not exactly what happens when we actually run pydoctor. See the other test test_prepend_package_real_path
.
Parameters | |
systemcls:Type[ | Undocumented |
In this test, we closer mimics what happens in the driver when --prepend-package option is passed.
Parameters | |
systemcls:Type[ | Undocumented |
@systemcls_param
def test_property_conflict(decoration, systemcls, capsys): (source) ¶
Warn when a method is decorated as both property and class/staticmethod. These decoration combinations do not create class/static properties.
Parameters | |
decoration:str | Undocumented |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
Any custom decorator with a name ending in 'property' makes a method into a property getter.
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
A function decorated with '@property' is documented as an attribute.
Parameters | |
systemcls:Type[ | Undocumented |
Property setter and deleter methods are renamed, so they don't replace the property itself.
Parameters | |
systemcls:Type[ | Undocumented |
capsys:CapSys | Undocumented |
If a target module, explicitly re-export via __all__ a set of names that were initially imported from a sub-module via a wildcard, those names are documented as part of the target module.
Parameters | |
systemcls:Type[ | Undocumented |
Relative imports in a package must be resolved by going up one level less, since we don't count "__init__.py" as a level.
Hierarchy:
top: def f - pkg: imports f and g - mod: def g
Parameters | |
systemcls:Type[ | Undocumented |
@pytest.mark.parametrize(
def test_relative_import_past_top(systemcls, level, capsys): (source) ¶
A warning is logged when a relative import goes beyond the top-level package.
Parameters | |
systemcls:Type[ | Undocumented |
level:int | Undocumented |
capsys:CapSys | Undocumented |
Type aliases and type variables are recognized as such.
Parameters | |
systemcls:Type[ | Undocumented |
Annotations or parts thereof that are strings are parsed and line number information is preserved.
Parameters | |
systemcls:Type[ | Undocumented |
Undocumented
Parameters | |
parsedParsedDocstring | Undocumented |
linker:DocstringLinker | Undocumented |
Returns | |
str | Undocumented |