-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regression tests of instance attribute inference on builtins.object
Ref #3595, #4221, #3970, pylint-dev/astroid#945. Depends pylint-dev/astroid#946.
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
tests/functional/r/regression/regression_3595_notcallable_collections.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# pylint: disable=missing-docstring,unused-import | ||
# https://github.com/PyCQA/pylint/issues/3595 | ||
|
||
import collections | ||
|
||
class Example: | ||
def __init__(self): | ||
self.prev() | ||
self.next() | ||
def prev(self): | ||
pass | ||
def next(self): | ||
pass |
8 changes: 8 additions & 0 deletions
8
tests/functional/r/regression/regression_4221_object_instanceattr.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# pylint: disable=missing-docstring | ||
# https://github.com/PyCQA/pylint/issues/4221 | ||
|
||
import random | ||
o = object() | ||
if random.choice([True, False]): | ||
o.count = None | ||
"abc".count("a") |