diff options
| author | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-06-05 11:18:13 +0200 |
|---|---|---|
| committer | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-06-05 11:29:34 +0200 |
| commit | 39c2a9805970ca57093d32bbaf0e6a63e05041d8 (patch) | |
| tree | fca85d4923264661de8aca23f4387100d9f7be26 /tests | |
| parent | 630b0699ea75a978253a16807b4c12d668824013 (diff) | |
| download | astroid-git-39c2a9805970ca57093d32bbaf0e6a63e05041d8.tar.gz | |
Allow passing arguments as ``None`` to ``FunctionDef`` builder
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unittest_builder.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unittest_builder.py b/tests/unittest_builder.py index d315a97c..61ef1bba 100644 --- a/tests/unittest_builder.py +++ b/tests/unittest_builder.py @@ -945,6 +945,13 @@ def test_parse_module_with_invalid_type_comments_does_not_crash(): assert isinstance(node, nodes.Module) +def test_arguments_of_signature() -> None: + """Test that arguments is None for function without an inferable signature.""" + node = builder.extract_node("int") + classdef: nodes.ClassDef = next(node.infer()) + assert all(i.args.args is None for i in classdef.getattr("__dir__")) + + class HermeticInterpreterTest(unittest.TestCase): """Modeled on https://github.com/PyCQA/astroid/pull/1207#issuecomment-951455588""" |
