summaryrefslogtreecommitdiff
path: root/tests/functional/c/consider/consider_using_with.py
Commit message (Collapse)AuthorAgeFilesLines
* [PyCQA migration] Upgrade links to the repositories in code and doc (#8514)Pierre Sassoulas2023-03-291-1/+1
|
* ``consider-using-with`` now triggers for ``pathlib.Path.open`` (#7968)Gideon2022-12-211-0/+11
|
* Fix #3675: `safe_infer()` finds ambiguity among function definitions when ↵Jacob Walls2021-12-141-1/+1
| | | | | number of arguments differ (#5409) Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Add unspecified-encoding checker #3826 (#4753)Daniël van Noord2021-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add unspecified-encoding checker #3826 This adds an unspecified-encoding checker that adds a warning whenever open() is called without an explicit encoding argument. This closes #3826 * Update tests to conform to unspecified-encoding With addition of the unspecified-encoding checker calls of open() need an encoding argument. Where necessary this argument has been added, or the message has been disabled. This also includes small linting changes to a small number of tests. Their test-data has been updated to reflect new line numbers. * Update scripts to conform to unspecified-encoding With addition of the unspecified-encoding checker calls of open() need an encoding argument. Where necessary this argument has been added. * Update pylint to conform to unspecified-encoding With addition of the unspecified-encoding checker calls of open() need an encoding argument. Where necessary this argument has been added. Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Fix crash if a callable returning a context manager was assigned to a list ↵DudeNr332021-07-211-0/+14
| | | | | | or dict item (#4733) * Fix crash if left hand side of assignment is neither ``astroid.AssignName`` nor ``astroid.AssignAttr`` * Add ChangeLog and whatsnew entry
* Fix 4689 Exclude ``ThreadPoolExecutor`` and ``ProcessPoolExecutor`` from ↵DudeNr332021-07-201-11/+64
| | | | | | | | | | | | ``consider-using-with`` (#4721) * Do not immediately emit ``consider-using-with`` if a context manager is assigned to a variable. Instead check if it is used later on in a ``with`` block. * Enhance check to also work for tuple unpacking in assignments * Remove ``ThreadPoolExecutor`` and ``ProcessPoolExecutor`` from list of callables that trigger the ``consider-using-with`` message Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix false-positive ``consider-using-with`` when using ↵DudeNr332021-07-041-0/+8
| | | | | | | | | ``contextlib.ExitStack`` (#4665) * Fix false-positive ``consider-using-with`` when using ``contextlib.ExitStack`` * Add ``whatsnew`` entry for #4654 * Python 3.6 needs special treatment - ``ExitStack`` did not inherit from ``_BaseExitStack`` until Python 3.7
* Issue 4430 false positive consider-using-with R1732 (#4453)DudeNr332021-05-091-8/+26
| | | | | * Suppress consider-using-with if used inside context manager * Added ChangeLog entry
* Enhancement #3413 ``consider-using-with`` (#4372)DudeNr332021-04-231-0/+138
* Implement consider-using-with check * Fix or disable consider-using-with in codebase * Fix ticket number in ChangeLog * Move functional test for ``open()`` into separate testfile and exclude this test from running with PyPy Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>