diff options
author | Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> | 2021-08-18 17:52:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-18 17:52:22 +0200 |
commit | be039201f0d3ce2c0664f312646733b2a5af69c5 (patch) | |
tree | e42a3a209811b993626ea9b7270b58f988f80cc2 /tests/data | |
parent | 53da6541dbe621b55f2c7f1bfcf821541dc823e8 (diff) | |
download | pylint-git-be039201f0d3ce2c0664f312646733b2a5af69c5.tar.gz |
pyreverse - Handle a regression with typehints of type astroid.Subscript (#4859)
* pyreverse - Handle a regression with typehints of type astroid.Subscript
Closes #4845
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* pyreverse - Handle a regression with typehints of type astroid.Subscript
- Add test-case to pyreverse data files
Closes #4845
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'tests/data')
-rw-r--r-- | tests/data/suppliermodule_test.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/data/suppliermodule_test.py b/tests/data/suppliermodule_test.py index add637d4a..9c8b05d52 100644 --- a/tests/data/suppliermodule_test.py +++ b/tests/data/suppliermodule_test.py @@ -1,4 +1,5 @@ """ file suppliermodule.py """ +from typing import Optional class Interface: def get_value(self): @@ -14,9 +15,14 @@ class DoNothing: pass class DoNothing2: pass class DoSomething: - def __init__(self, a_string: str, optional_int: int = None): + def __init__( + self, + a_string: str, + optional_int: int = None, + optional_int_2: Optional[int] = None): self.my_string = a_string self.my_int = optional_int + self.my_int_2 = optional_int_2 def do_it(self, new_int: int) -> int: return self.my_int + new_int |