summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Corrected the parent of function type comment nodesfix_851Ashley Whetter2021-01-311-0/+13
| | | | | | | These nodes used to be parented to their original ast.FunctionDef parent but are now correctly parented to their astroid.FunctionDef parent. Closes #851
* Julien palard mdk/class getitem (#885)hippo912021-01-241-0/+11
| | | | | | | | | | | | | | | * Add missing __class_getitem__ to deque. * The __class_getitem__ method is added only for python versions above 3.9 * Adds two tests that ensure that __class_getitem__ method is not present for python versions prior to 3.9 but present for python versions above 3.9 * Reorganizes * Adds an entry * Add Julien Palard in copyright Co-authored-by: Julien Palard <julien@palard.fr>
* Merge branch 'sum_and_multiply' of https://github.com/hippo91/astroidsum_and_multiplyhippo912021-01-233-7/+8
|\
| * Merge branch 'master' into sum_and_multiplyhippo912020-06-2087-962/+725
| |\
| * \ Merge branch 'master' into sum_and_multiplyhippo912019-12-301-0/+6
| |\ \
| * | | Corrects the use of numpy.multiply functionhippo912019-12-301-1/+1
| | | |
| * | | Updates two tests that deal with the number of visits and the context.pathhippo912019-12-301-2/+3
| | | |
| * | | Insures that numpy functions returning arrays are inferred only as array and ↵hippo912019-12-301-4/+2
| | | | | | | | | | | | | | | | not [array, Uninferable] because it could lead to false negatives.
| * | | Add the test of functions add and multiplyhippo912019-12-281-0/+2
| | | |
* | | | Merge pull request #883 from hippo91/bug_pylint_4001hippo912021-01-231-0/+36
|\ \ \ \ | | | | | | | | | | Bug pylint 4001
| * | | | Formatting according to blackhippo912021-01-201-2/+2
| | | | |
| * | | | Adds dochippo912021-01-191-0/+9
| | | | |
| * | | | Adds unittest for brain_type modulehippo912021-01-181-0/+27
| | | | |
* | | | | brain: Add `__class_getitem__` to `subprocess.Popen` starting from Python 3.9Damien Baty2021-01-181-0/+7
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is necessary for pylint to detect that `subprocess.Popen` is subscriptable, starting from Python 3.9 (see PyCQA/pylint#4034). $ python3.9 >>> import subprocess >>> subprocess.Popen.__class_getitem__ <bound method GenericAlias of <class 'subprocess.Popen'>>
* | | | ``is_generator`` correctly considers `Yield` nodes in `AugAssign` nodesClaudiu Popa2021-01-011-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | This fixes a false positive with the `assignment-from-no-return` pylint check. Close PyCQA/pylint#3904
* | | | Fix a crash in inference caused by `Uninferable` container elementsClaudiu Popa2021-01-011-0/+14
| | | | | | | | | | | | | | | | Close #866
* | | | Fix a bug for dunder methods inference of function objectsClaudiu Popa2020-12-301-0/+11
| | | | | | | | | | | | | | | | Fixes #819
* | | | Add the function random that is an alias of random_samplehippo912020-12-291-0/+1
| | | |
* | | | Adds the ufunc degrees and radians testshippo912020-12-291-0/+2
| | | |
* | | | Back to original file after debugging sessionhippo912020-12-281-2/+1
| | | |
* | | | Adds debug msghippo912020-12-281-1/+2
| | | |
* | | | New copyright noticeshippo912020-12-2721-13/+27
| | | |
* | | | Do not crash when encountering starred assignments in enums.Claudiu Popa2020-12-261-0/+10
| | | | | | | | | | | | | | | | Close #835
* | | | Merge pull request #858 from hippo91/fix_python39_newhippo912020-12-131-0/+29
|\ \ \ \ | | | | | | | | | | Fix python39
| * | | | Thanks to the preceeding commit the inference is more precise for class ↵hippo912020-11-221-0/+29
| | | | | | | | | | | | | | | | | | | | decorated with dataclasses
* | | | | Merge pull request #857 from pkolbus/remove-imphippo912020-12-134-18/+23
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | Remove dependency on imp. Many thanks @pkolbus and @degustaf !
| * | | | | Remove dependency on imp.Peter Kolbus2020-11-274-18/+23
| |/ / / /
* | | | | Fix formatting regressionTim Martin2020-10-161-9/+1
| | | | |
* | | | | Fix incorrect MRO being calculated for scoped multiple inheritanceTim Martin2020-10-131-0/+24
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | If a class inherits from two bases and the classes are expressed as a non-trivial expression such as qualified with a module name, classes after the first could not be inferred due to reusing the context object in _inferred_bases
* | | | Adds ndarray as rtype for T attribute.hippo912020-09-141-1/+1
| | | | | | | | | | | | Closes PyCQA/pylint#3387
* | | | Skip test for | in dictionaries due to PEP-584 in Python 3.9+ (#829)Karthikeyan Singaravelan2020-09-141-2/+6
| | | |
* | | | Squash one-off inference utility functions to help reduce recursion errors ↵Bryce Guinta2020-06-231-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (#804) This also makes debugging a lot simpler reducing the complexity of the function stack.
* | | | Separate string and bytes classes patching (#807)Claudiu Popa2020-06-232-8/+19
| | | | | | | | | | | | Fixes PyCQA/pylint#3599
* | | | Squash one-off inference utility functions to help reduce recursion errors ↵Bryce Guinta2020-06-221-1/+1
| |_|/ |/| | | | | | | | | | | | | | (#804) This also makes debugging a lot simpler reducing the complexity of the function stack.
* | | Fix a crash caused by a lookup of a monkey-patched method (#803)Claudiu Popa2020-06-161-0/+19
| | | | | | | | | | | | Close PyCQA/pylint#3686
* | | `FunctionDef.is_generator` properly handles `yield` nodes in `If` tests (#799)Claudiu Popa2020-06-091-0/+13
| | | | | | | | | Close PyCQA/pylint#3583
* | | Add exception inference for `UnicodeDecodeError` (#797)Claudiu Popa2020-05-291-0/+11
| | | | | | | | | Close PyCQA/pylint#3639
* | | Properly construct the arguments of infered property descriptors (#796)Claudiu Popa2020-05-281-0/+17
| | | | | | | | | Close PyCQA/pylint#3648
* | | Remove unneeded python2 test dataDavid Cain2020-05-2160-547/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now that astroid no longer supports Python 2, there's reason to keep this test data around. The `tests/testdata/python2` directory is not referenced at all, so we may safely delete it. It's perhaps just worth moving all of `testdata/python3` into a new directory, but this is a start.
* | | `FunctionDef.is_generator` properly handles `yield` nodes in `While` testsClaudiu Popa2020-05-121-0/+12
| | | | | | | | | | | | Close PyCQA/pylint#3519
* | | Protect against ``infer_call_result`` failing with `InferenceError` in ↵Claudiu Popa2020-05-011-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | `Super.getattr()` (#782) ``infer_call_result`` can raise InferenceError but we were not handling that when retrieving objects from the Super instance. Close PyCQA/pylint#3529
* | | Do not crash with SyntaxError when parsing namedtuples with invalid labelClaudiu Popa2020-05-011-0/+12
| | | | | | | | | | | | Close PyCQA/pylint#3549
* | | Add missing copyright annotations for the past releasesClaudiu Popa2020-04-2726-34/+86
| | |
* | | Add posonlyargs_annotations to Arguments.as_string()Claudiu Popa2020-03-281-0/+6
| | |
* | | ``BoundMethod.implicit_parameters`` returns a proper value for ``__new__``Claudiu Popa2020-03-261-0/+21
| | | | | | | | | | | | Close PyCQA/pylint#2335
* | | Allow `FunctionDef.getattr` to look into both instance attrs and special ↵Claudiu Popa2020-03-261-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | attributes Modifying an attribute of a function with an augmented assignment resulted in `FunctionDef.getattr` to prioritize the instance attributes fetching. This means that only the augmented assignment modification would have been visible. Close PyCQA/pylint#1078
* | | Allow slots added dynamically to a class to still be inferredClaudiu Popa2020-03-131-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 2aa27e9aed6ffcba4a61655e291e852ecd001549 `ClassDef.igetattr` was modified to only grab the first item from the result of `getattr`, in order to avoid looking up attributes in the ancestors path when inferring attributes for a given class. This had the side effect that we'd omit attribute definitions happening in the same scope, such as augmented assignments, which in turn might have affected other capabilities, such as slots inference. This commit changes the approach a bit and keeps all attributes as long as all of them are from the same class (be it current or an ancestor) Close PyCQA/pylint#2334
* | | Add a regression test for inferring self in lambdaClaudiu Popa2020-03-121-0/+12
| | | | | | | | | | | | Close #425
* | | Kill `extrapath` from various `modutils` functions as it was not usedClaudiu Popa2020-03-111-8/+0
| | |
* | | Add a new ast_from_string method to AstroidManagerAnubhav2020-03-111-0/+11
| | | | | | | | | Close #725