summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Add missing ssl enums to astroid/brain (#1381)Alexander Scheel2022-06-062-10/+43
| | | | | Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com> Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Add `pathlib` brain to handle `.parents` inference (#1442)Deepyaman Datta2022-06-051-0/+86
| | | | Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Infer instances of builtins created by __new__() (#1590)Jacob Walls2022-06-051-0/+27
|
* Infer the actual unpacked value on Dict's getitem() (#1196)Batuhan Taskaya2022-06-051-1/+30
| | | Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Allow passing arguments as ``None`` to ``FunctionDef`` builderDaniël van Noord2022-06-051-0/+7
|
* Fix inference of ``Enums`` when they are imported under an alias (#1587)Daniël van Noord2022-06-021-0/+14
|
* Add ``typing-extensions`` to test dependencies (#1586)Daniël van Noord2022-06-021-5/+1
|
* More conservative interpretation of `PathFinder.find_spec()` failures (#1581)Jacob Walls2022-05-311-0/+9
|
* Special case `__main__` in `is_namespace()` (#1579)Jacob Walls2022-05-311-0/+1
|
* Revert #1575 and catch further `KeyError`s (#1576)Jacob Walls2022-05-301-0/+3
| | | Provide `ModuleSpec.submodule_search_locations` to the `path` argument of `PathFinder.find_spec()`
* Provide first component of dotted path to namespace searches (#1575)Jacob Walls2022-05-304-0/+7
| | | | | | * Use first component of dotted path only in namespace searches * Add test and catch KeyError instead of altering search strategy
* Capture and log messages emitted by C modules when importing them (#1514)Jacob Walls2022-05-231-1/+36
| | | | | Prevent contaminating programmatic output, e.g. pylint's JSON reporter. Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Permit subscripting additional builtin classes (#1572)Jacob Walls2022-05-232-5/+3
| | | Treat other classes such as enumerate and staticmethod identically to list, dict, tuple, set, frozenset.
* Remove dependency on `pkg_resources` from `setuptools` (#1536)Jacob Walls2022-05-221-9/+13
| | | Avoid using `importlib.util.find_spec()` to avoid actually importing parent packages.
* Avoid a global state in `utils.builtin_lookup` and avoid reinstantiating ↵Jacob Walls2022-05-221-1/+14
| | | | | `TransformVisitor` (#1563) The global state of `utils.builtin_lookup` could be out-of-date if the builtins module had been rebuilt by AstroidManager.clear_cache(). Also, reinstantiating `TransformVisitor` in `clear_cache()` could lead to to diverging registries of transforms.
* Fix inference from nested unpacking of iterables (#1311)Mark Byrne2022-05-162-0/+81
|
* Fix 3.11 test (#1558)Marc Mueller2022-05-131-6/+17
| | | | | | Issue with reassigned __traceback__ attribute. In some cases it can be uninferable now. Ref: #1551
* Fix ImportedModuleTests (#1552)Jacob Walls2022-05-131-32/+54
|
* Update typing for Python 3.7 (2) (#1556)Marc Mueller2022-05-134-4/+6
|
* Update typing for Python 3.7 (1) (#1555)Marc Mueller2022-05-1310-54/+71
|
* Update pylint to 2.14.0b1 (#1553)Marc Mueller2022-05-121-5/+3
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Remove some test skips (#1554)Jacob Walls2022-05-122-6/+0
|
* qt brain: Make slot argument optional for disconnect() (#1550)Florian Bruhin2022-05-121-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qt brain: Make slot argument optional for disconnect() Discussed here: https://github.com/PyCQA/astroid/pull/1531#issuecomment-1111963792 PyQt supports calling .disconnect() without any arguments in order to disconnect all slots: https://www.riverbankcomputing.com/static/Docs/PyQt6/signals_slots.html#disconnect Strictly speaking, slot=None is a wrong call, as actually passing None does not work: https://github.com/python-qt-tools/PyQt5-stubs/pull/103 However, pylint/astroid does not support overloads needed to properly express this: https://github.com/PyCQA/pylint/issues/5264 So, while this is "wrong", it's less wrong than before - without this change, pylint expects a mandatory argument, thus raising a false-positive here: from PyQt5.QtCore import QTimer t = QTimer() t.timeout.connect(lambda: None) t.timeout.disconnect() despite running fine, pylint complains: test.py:4:0: E1120: No value for argument 'slot' in method call (no-value-for-parameter) while with this change, things work fine.
* More tests for imported modules (#1399)tristanlatr2022-05-111-0/+36
| | | Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* Infer returned value of .copy() method for collections (#1540)Tim Martin2022-05-101-0/+31
| | | Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Require Python 3.7.2 (#1542)Jacob Walls2022-05-103-31/+1
|
* Fix crash while obtaining `object_type()` of an `Unknown` node (#1547)Jacob Walls2022-05-071-0/+8
|
* Let `AstroidManager.clear_cache` act on other caches (#1521)Jacob Walls2022-05-062-1/+42
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Prevent special case for `virtualenv`'s patching of `distutils` from ↵Jacob Walls2022-05-051-0/+17
| | | | catching other submodules (#1544)
* Let `AstroidManager.clear_cache` reload brain plugins (#1528)Jacob Walls2022-05-042-6/+16
|
* Improve recognition of ``_io`` module during bootstrapping on ``PyPy`` (#1529)Daniël van Noord2022-05-021-4/+1
|
* Fix a crash involving two starred expressions inside a call (#1535)Jacob Walls2022-04-301-0/+11
|
* Make `FunctionDef.implicit_parameters` return 1 for methods (#1531)Jacob Walls2022-04-302-1/+35
|
* Fix a crash when `_filter_stmts` encounters an `EmptyNode` (#1534)Jacob Walls2022-04-301-0/+17
|
* Fix ``col_offset`` attribute for nodes involving ``with`` on ``PyPy`` (#1520)Daniël van Noord2022-04-221-6/+38
| | | Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Fix `instance_attrs` building error in Qt brain (#1505)Jacob Walls2022-04-141-0/+38
| | | Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Fix for loop that reassigns the iterable it is iteratingPierre Sassoulas2022-04-071-4/+4
|
* Avoid adding the name of a parent namedtuple to child's locals (#1489)Jacob Walls2022-03-261-0/+2
|
* Fix incorrect xfailed testDaniël van Noord2022-03-231-6/+3
|
* Fix crash on direct inference via nodes.FunctionDef._infer (#1477)Daniël van Noord2022-03-151-0/+6
|
* Promoted ``getattr()`` from FunctionDef to Lambda (#1472)Jacob Walls2022-03-122-1/+8
| | | Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Upgrade mypy to 0.940 (#1466)Daniël van Noord2022-03-122-7/+7
| | | Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Simplify hard to maintain copyright notice (#1441)Pierre Sassoulas2022-03-1236-404/+67
| | | | | | | | | | | | | | * Simplify hard to maintain copyright notice git is the source of truth for the copyright, copyrite (the tool) was taking exponentially longer with each release, and it's polluting the code with sometime as much as 50 lines of names. * Add a pre-commit hook to check the copyright notice * Fix the existing file so they have a notice * Fix the spacing after the copyright notice * Add a script to generate the CONTRIBUTORS.txt Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Add missing shape parameter to numpy methods (#1450)Mark Byrne2022-03-091-0/+25
| | | | | | Closes PyCQA/pylint#5871 Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Deprecate passing the doc argument (#1453)Daniël van Noord2022-03-091-0/+9
| | | Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Do no pass ``doc`` attribute to ``nodes.Module`` in tests (#1455)Daniël van Noord2022-03-092-7/+4
|
* Pass ``doc_node`` to postinit of all ``Property`` constructors (#1436)Daniël van Noord2022-03-091-0/+20
| | | Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Replace platform import (#1459)Marc Mueller2022-03-097-22/+14
|
* Fix end_lineno on PyPy 3.8 (#1454)Marc Mueller2022-03-093-10/+16
| | | | * Fix end_lineno on PyPy 3.8 * Add CI job for PyPy 3.8
* Do not use ``doc`` attribute internally (#1433)Daniël van Noord2022-03-071-4/+2
| | | Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>