ruff/crates/ruff_linter/resources/test/fixtures/flake8_pytest_style
Denys Kyslytsyn 97dd6d120c
[`flake8-pytest-style`] Avoid false positive for legacy form of `pytest.raises` (`PT011`) (#17231)
This fix closes #17026 

## Summary

The check for the `PytestRaisesTooBroad` rule is now skipped if there is
a second positional argument present, which means `pytest.raises` is
used as a function.

## Test Plan

Tested on the example from the issue, which now passes the check.
```Python3
pytest.raises(Exception, func, *func_args, **func_kwargs).match("error message")
```

---------

Co-authored-by: Micha Reiser <micha@reiser.io>
2025-04-08 09:24:47 +02:00
..
PT001.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT002.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT003.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT006.py Fix `pytest-parametrize-names-wrong-type (PT006)` to edit both `argnames` and `argvalues` if both of them are single-element tuples/lists (#14699) 2024-12-09 09:58:52 +01:00
PT006_and_PT007.py Fix `pytest-parametrize-names-wrong-type (PT006)` to edit both `argnames` and `argvalues` if both of them are single-element tuples/lists (#14699) 2024-12-09 09:58:52 +01:00
PT007.py [`flake8-pytest-style`] Fix single-tuple conversion in `pytest-parametrize-values-wrong-type` (#10862) 2024-04-10 14:20:09 -04:00
PT008.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT009.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT010.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT011.py [`flake8-pytest-style`] Avoid false positive for legacy form of `pytest.raises` (`PT011`) (#17231) 2025-04-08 09:24:47 +02:00
PT012.py [`flake8-pytest-style`] Do not emit diagnostics for empty `for` loops (`PT012`, `PT031`) (#15542) 2025-01-17 01:44:07 +00:00
PT013.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT014.py Fix `PT014` autofix for last item in list (#10532) 2024-03-23 09:26:42 -04:00
PT015.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT016.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT017.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT018.py Rename `Autofix` to `Fix` (#7657) 2023-09-28 10:53:05 +00:00
PT019.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT020.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT021.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT022.py Update return type for `PT022` autofix (#7613) 2023-09-24 06:39:47 +00:00
PT023.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT024.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT025.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT026.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT027_0.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
PT027_1.py [`flake8-pytest-style`] Rewrite references to `.exception` (`PT027`) (#15680) 2025-01-23 17:50:40 +01:00
PT028.py [`flake8-pytest-style`] Test function parameters with default arguments (`PT028`) (#15449) 2025-01-13 13:40:54 +01:00
PT029.py [`flake8-pytest-style`] Implement pytest.warns diagnostics (`PT029`, `PT030`, `PT031`) (#15444) 2025-01-13 01:46:59 +00:00
PT030.py [`flake8-pytest-style`] Implement pytest.warns diagnostics (`PT029`, `PT030`, `PT031`) (#15444) 2025-01-13 01:46:59 +00:00
PT031.py [`flake8-pytest-style`] Do not emit diagnostics for empty `for` loops (`PT012`, `PT031`) (#15542) 2025-01-17 01:44:07 +00:00
is_pytest_test.py [`flake8-pytest-style`] Test function parameters with default arguments (`PT028`) (#15449) 2025-01-13 13:40:54 +01:00