summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Create ``ContextManagerModel`` and let ``GeneratorModel`` inheritDaniël van Noord2022-09-291-0/+47
|
* Handle empty ``modname`` in ``ast_from_module_name`` (#1801)Daniël van Noord2022-09-231-0/+4
|
* improve is_namespace checkSaugat Pachhai (सौगात)2022-09-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://stackoverflow.com/a/42962529. Let's take the following contents as an example: ```python import celery.result ``` From #1777, astroid started to use `processed_components` for namespace check. In the above case, the `modname` is `celery.result`, it first checks for `celery` and then `celery.result`. Before that PR, it'd always check for `celery.result`. `celery` is recreating module to make it lazily load. See https://github.com/celery/celery/blob/34533ab44d2a6492004bc3df44dc04ad5c6611e7/celery/__init__.py#L150. This module does not have `__spec__` set. Reading through Python's docs, it seems that `__spec__` can be set to None, so it seems like it's not a thing that we can depend upon for namespace checks. See https://docs.python.org/3/reference/import.html#spec__. --- The `celery.result` gets imported for me when pylint-pytest plugin tries to load fixtures, but this could happen anytime if any plugin imports packages. In that case, `importlib.util._find_spec_from_path("celery")` will raise ValueError since it's already in `sys.modules` and does not have a spec. Fixes https://github.com/PyCQA/pylint/issues/7488.
* [flake8] Set the max line length to 110 instead of 138Pierre Sassoulas2022-09-194-10/+13
| | | | | Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
* Fixed the ``__init__`` of ``dataclassess`` with multiple inheritance (#1774)Daniël van Noord2022-09-071-0/+132
|
* Fix a crash on ``namedtuples`` that use ``typename`` (#1773)Daniël van Noord2022-09-071-0/+17
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix crash in ``dataclass`` brain (#1770)Daniël van Noord2022-09-061-0/+24
|
* Parse default values in ``dataclass`` attributes correctly (#1771)Daniël van Noord2022-09-061-0/+41
|
* Fix crash in ``dataclass`` brain (#1768)Daniël van Noord2022-09-061-0/+23
|
* Handle ``dataclass`` ``kw_only`` keyword correctly (#1764)Daniël van Noord2022-09-051-2/+79
| | | Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* Fix a crash involving `Uninferable` args to `namedtuple` (#1763)Jacob Walls2022-09-041-0/+20
|
* Prevent first-party imports from being resolved to `site-packages` (#1756)Jacob Walls2022-08-291-1/+4
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix namespace package detection for frozen stdlib modules on PyPy (#1757)Jacob Walls2022-08-271-1/+12
|
* Fix crash involving non-standard type comments (#1753)Daniël van Noord2022-08-251-0/+8
|
* Don't rely on the module cache when "importing self" (#1747)Daniël van Noord2022-08-232-0/+20
| | | Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* Remove str instance in model of BaseException.attrs (#1749)Daniël van Noord2022-08-231-0/+15
| | | | | | | | Do not require first exception argument to be a string. The word "usually" does not imply an obligation. https://docs.python.org/3/library/exceptions.html#BaseException.args Co-authored-by: Nicholas Guriev <nicholas@guriev.su>
* Fix false positive with inference of `http` module (#1742)Mark Byrne2022-08-231-1/+14
| | | | Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com> Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Don't add ``KW_ONLY`` fields to dataclass fields (#1746)Daniël van Noord2022-08-221-0/+34
|
* Fix crash with inference of type-annotated Enum classes (#1743)Mark Byrne2022-08-191-0/+19
| | | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Fix a crash inferring invalid string formatting with `%`Jacob Walls2022-08-121-0/+1
|
* Fix crash in `ExplicitNamespacePackageFinder` (#1714)Jacob Walls2022-08-091-0/+17
| | | | | | | * Add skip if no `six` * `urllib3` does appear to be required * Check `submodule_search_locations` Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* [pre-commit.ci] pre-commit autoupdate (#1726)pre-commit-ci[bot]2022-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/pyupgrade: v2.37.2 → v2.37.3](https://github.com/asottile/pyupgrade/compare/v2.37.2...v2.37.3) - https://github.com/Pierre-Sassoulas/black-disable-checker/: v1.1.0 → v1.1.1 - [github.com/PyCQA/flake8: 4.0.1 → 5.0.3](https://github.com/PyCQA/flake8/compare/4.0.1...5.0.3) * Disable line too long and line break before binary operator As there's a lot of the format and the latter is incompatible with black. * [flake8] Deactivate the check for return and yield together It's opinionated see https://github.com/PyCQA/flake8-bugbear/issues/2 and every current warning is a false positive. * Explain falke8 disables Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Fix false positive with inference of type-annotated Enum classes. (#1734)Mark Byrne2022-08-071-0/+72
| | | Refs PyCQA/pylint#7265
* Fixes #1717 - ignore FutureWarnings which are raised by pandas (#1719)Tim Paine2022-07-232-0/+38
| | | | | And probably other modules too.
* Catch RecursionError in ``raise_if_nothing_inferred`` (#1705)Daniël van Noord2022-07-111-1/+19
|
* Prevent applying boolean ops to `NotImplemented` (#1702)Jacob Walls2022-07-101-0/+6
|
* Only infer module operations on string ``Const`` nodes (#1701)Daniël van Noord2022-07-101-0/+1
|
* Fix a crash when inferring old-style string formatting (`%`) using tuples ↵Jacob Walls2022-07-091-0/+3
| | | | (#1697)
* Fix a crash when `None` participates in a `**` expression (#1696)Jacob Walls2022-07-091-0/+4
|
* Fix a crash involving properties within `if` blocksJacob Walls2022-07-091-0/+20
|
* Fix a crash involving properties within ``try ... except`` blocksDaniël van Noord2022-07-081-0/+24
|
* Add ``__init__`` to the ``ObjectModel`` and return ``BoundMethods`` (#1687)Daniël van Noord2022-07-062-4/+100
| | | Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* Fix order of attribute look ups for Super (#1686)Daniël van Noord2022-07-062-1/+61
|
* Fix ``pylint`` issues and remove useless disablesDaniël van Noord2022-07-063-5/+3
|
* Add brain for numpy core module ``einsumfunc``. (#1656)Mark Byrne2022-07-061-0/+58
| | | Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Add ``__new__`` and ``__call__`` to``ObjectModel`` and ``ClassModel`` (#1606)Daniël van Noord2022-07-031-0/+18
|
* Prevent creating `Instance` that proxies another `Instance` when inferring ↵Jacob Walls2022-07-021-0/+9
| | | | `__new__(cls)` (#1682)
* Avoid inferring all subscripted names in `pathlib` brain (#1671)Jacob Walls2022-06-291-8/+2
|
* Fix inference of living container elements (#1663)Daniël van Noord2022-06-251-0/+38
| | | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Refs #1662: Condition `usedforsecurity` support on Py3.9+ (#1665)Jacob Walls2022-06-251-2/+6
|
* `hashlib`: Add support for `usedforsecurity` keyword (#1662)Jacob Walls2022-06-251-2/+2
|
* Fix the qt brain for Signals on PySide 2 and 6 (#1654)adam-grant-hendry2022-06-251-1/+1
| | | | Co-authored-by: Hendry, Adam <adam.hendry@medtronic.com> Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Revert #893: Avoid setting a Call as a base for metaclasses from ↵Jacob Walls2022-06-231-1/+17
| | | | six.with_metaclass() (#1622)
* Avoid performing `**` operations on values greater than 1e5Jacob Walls2022-06-211-0/+6
|
* Remove remaining references to old Mixin base nodesDaniël van Noord2022-06-201-1/+1
|
* Infer modulo operations on strings (#1617)Daniël van Noord2022-06-171-1/+112
|
* Infer calls to ``format()`` on variables that are strings (#1616)Daniël van Noord2022-06-121-0/+7
|
* Fix ``str.format`` with ``KeyError``Daniël van Noord2022-06-111-0/+3
|
* Infer calls to ``str.format`` (#1602)Daniël van Noord2022-06-103-10/+101
| | | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* `argparse` brain: avoid spurious addition of "namespace" to function localsJacob Walls2022-06-091-0/+21
|