-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flake8-bugbear
] Add pytest.raises(Exception)
support to B017
#4052
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alanhdu
commented
Apr 20, 2023
/// | ||
/// Either assert for a more specific exception (builtin or custom), use | ||
/// `assertRaisesRegex` or the context manager form of `assertRaises`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This felt misleading, since the context manager form of assertRaises
actually gives a lint error!
PR Check ResultsEcosystemℹ️ ecosystem check detected changes. (+22, -0, 0 error(s)) airflow (+20, -0)
+ tests/jobs/test_scheduler_job.py:1696:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/amazon/aws/hooks/test_base_aws.py:961:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/amazon/aws/hooks/test_base_aws.py:966:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/amazon/aws/hooks/test_ecs.py:146:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/amazon/aws/hooks/test_glue_catalog.py:118:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/amazon/aws/log/test_s3_task_handler.py:107:13: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/amazon/aws/operators/test_athena.py:123:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/amazon/aws/operators/test_athena.py:148:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/amazon/aws/operators/test_athena.py:172:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/amazon/aws/operators/test_athena.py:195:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/apache/beam/hooks/test_beam.py:372:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/google/cloud/hooks/test_dataflow.py:1901:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/google/cloud/hooks/test_dataproc.py:1031:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/google/common/hooks/test_base_google.py:251:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/google/common/hooks/test_base_google.py:277:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/google/common/hooks/test_base_google.py:327:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/google/common/hooks/test_base_google.py:348:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/microsoft/azure/hooks/test_azure_synapse.py:174:13: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/mysql/transfers/test_s3_to_mysql.py:89:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/providers/ssh/hooks/test_ssh.py:943:9: B017 `pytest.raises(Exception)` should be considered evil bokeh (+2, -0)
+ tests/unit/bokeh/io/test_state.py:86:9: B017 `pytest.raises(Exception)` should be considered evil
+ tests/unit/bokeh/io/test_state.py:88:9: B017 `pytest.raises(Exception)` should be considered evil BenchmarkLinux
Windows
|
charliermarsh
changed the title
Add pytest.raises(Exception) support to B017
[Apr 21, 2023
flake8-bugbear
] Add pytest.raises(Exception)
support to B017
Thank you! |
renovate bot
referenced
this pull request
in ixm-one/pytest-cmake-presets
Apr 25, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://togithub.com/charliermarsh/ruff) | `^0.0.262` -> `^0.0.263` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/compatibility-slim/0.0.262)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/confidence-slim/0.0.262)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.263`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.263) [Compare Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.262...v0.0.263) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### Rules - \[`flake8-bugbear`] Add `pytest.raises(Exception)` support to B017 by [@​alanhdu](https://togithub.com/alanhdu) in [https://github.com/charliermarsh/ruff/pull/4052](https://togithub.com/charliermarsh/ruff/pull/4052) - \[`flake8-import-conventions`] Implement new rule `ICN003` to ban `from ... import ...` for selected modules by [@​edgarrmondragon](https://togithub.com/edgarrmondragon) in [https://github.com/charliermarsh/ruff/pull/4040](https://togithub.com/charliermarsh/ruff/pull/4040) - \[`pylint`] Implement PLE0302 `unexpected-special-method-signature` by [@​mccullocht](https://togithub.com/mccullocht) in [https://github.com/charliermarsh/ruff/pull/4075](https://togithub.com/charliermarsh/ruff/pull/4075) - \[`pep8-naming`] Ignore `N815` for `TypedDict` fields by [@​JonathanPlasse](https://togithub.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4066](https://togithub.com/charliermarsh/ruff/pull/4066) ##### Bug Fixes - Avoid `PYI015` for valid default value without annotation by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4043](https://togithub.com/charliermarsh/ruff/pull/4043) - Avoid infinite-propagation of inline comments when force-splitting imports by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4074](https://togithub.com/charliermarsh/ruff/pull/4074) - Fix SIM222 and SIM223 false positives and auto-fix by [@​JonathanPlasse](https://togithub.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4063](https://togithub.com/charliermarsh/ruff/pull/4063) - Unify positional and keyword arguments when checking for missing arguments in docstring by [@​evanrittenhouse](https://togithub.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4067](https://togithub.com/charliermarsh/ruff/pull/4067) - Avoid `RUF008` if field annotation is immutable by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4039](https://togithub.com/charliermarsh/ruff/pull/4039) - Increment priority should be (branch-local, global) by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4070](https://togithub.com/charliermarsh/ruff/pull/4070) - Ignore `ClassVar` annotation for `RUF008`, `RUF009` by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4081](https://togithub.com/charliermarsh/ruff/pull/4081) - Support --fix in watch mode by [@​evanrittenhouse](https://togithub.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4035](https://togithub.com/charliermarsh/ruff/pull/4035) #### New Contributors - [@​alanhdu](https://togithub.com/alanhdu) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4052](https://togithub.com/charliermarsh/ruff/pull/4052) - [@​pronoym99](https://togithub.com/pronoym99) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4055](https://togithub.com/charliermarsh/ruff/pull/4055) - [@​Secrus](https://togithub.com/Secrus) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4085](https://togithub.com/charliermarsh/ruff/pull/4085) - [@​madkinsz](https://togithub.com/madkinsz) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4084](https://togithub.com/charliermarsh/ruff/pull/4084) - [@​mccullocht](https://togithub.com/mccullocht) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4075](https://togithub.com/charliermarsh/ruff/pull/4075) **Full Changelog**: astral-sh/ruff@v0.0.262...v0.0.263 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/ixm-one/pytest-cmake-presets). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS41OC4yIiwidXBkYXRlZEluVmVyIjoiMzUuNTguMiJ9--> Signed-off-by: Renovate Bot <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot
referenced
this pull request
in allenporter/flux-local
Apr 27, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://togithub.com/charliermarsh/ruff) | `==0.0.262` -> `==0.0.263` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/compatibility-slim/0.0.262)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/confidence-slim/0.0.262)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.263`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.263) [Compare Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.262...v0.0.263) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### Rules - \[`flake8-bugbear`] Add `pytest.raises(Exception)` support to B017 by [@​alanhdu](https://togithub.com/alanhdu) in [https://github.com/charliermarsh/ruff/pull/4052](https://togithub.com/charliermarsh/ruff/pull/4052) - \[`flake8-import-conventions`] Implement new rule `ICN003` to ban `from ... import ...` for selected modules by [@​edgarrmondragon](https://togithub.com/edgarrmondragon) in [https://github.com/charliermarsh/ruff/pull/4040](https://togithub.com/charliermarsh/ruff/pull/4040) - \[`pylint`] Implement PLE0302 `unexpected-special-method-signature` by [@​mccullocht](https://togithub.com/mccullocht) in [https://github.com/charliermarsh/ruff/pull/4075](https://togithub.com/charliermarsh/ruff/pull/4075) - \[`pep8-naming`] Ignore `N815` for `TypedDict` fields by [@​JonathanPlasse](https://togithub.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4066](https://togithub.com/charliermarsh/ruff/pull/4066) ##### Bug Fixes - Avoid `PYI015` for valid default value without annotation by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4043](https://togithub.com/charliermarsh/ruff/pull/4043) - Avoid infinite-propagation of inline comments when force-splitting imports by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4074](https://togithub.com/charliermarsh/ruff/pull/4074) - Fix SIM222 and SIM223 false positives and auto-fix by [@​JonathanPlasse](https://togithub.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4063](https://togithub.com/charliermarsh/ruff/pull/4063) - Unify positional and keyword arguments when checking for missing arguments in docstring by [@​evanrittenhouse](https://togithub.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4067](https://togithub.com/charliermarsh/ruff/pull/4067) - Avoid `RUF008` if field annotation is immutable by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4039](https://togithub.com/charliermarsh/ruff/pull/4039) - Increment priority should be (branch-local, global) by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4070](https://togithub.com/charliermarsh/ruff/pull/4070) - Ignore `ClassVar` annotation for `RUF008`, `RUF009` by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4081](https://togithub.com/charliermarsh/ruff/pull/4081) - Support --fix in watch mode by [@​evanrittenhouse](https://togithub.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4035](https://togithub.com/charliermarsh/ruff/pull/4035) #### New Contributors - [@​alanhdu](https://togithub.com/alanhdu) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4052](https://togithub.com/charliermarsh/ruff/pull/4052) - [@​pronoym99](https://togithub.com/pronoym99) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4055](https://togithub.com/charliermarsh/ruff/pull/4055) - [@​Secrus](https://togithub.com/Secrus) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4085](https://togithub.com/charliermarsh/ruff/pull/4085) - [@​madkinsz](https://togithub.com/madkinsz) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4084](https://togithub.com/charliermarsh/ruff/pull/4084) - [@​mccullocht](https://togithub.com/mccullocht) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4075](https://togithub.com/charliermarsh/ruff/pull/4075) **Full Changelog**: astral-sh/ruff@v0.0.262...v0.0.263 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/allenporter/flux-local). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS41OC4yIiwidXBkYXRlZEluVmVyIjoiMzUuNTguMiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot
referenced
this pull request
in allenporter/pyrainbird
Apr 27, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://togithub.com/charliermarsh/ruff) | `==0.0.262` -> `==0.0.263` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/compatibility-slim/0.0.262)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/confidence-slim/0.0.262)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.263`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.263) [Compare Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.262...v0.0.263) <!-- Release notes generated using configuration in .github/release.yml at main --> ##### What's Changed ##### Rules - \[`flake8-bugbear`] Add `pytest.raises(Exception)` support to B017 by [@​alanhdu](https://togithub.com/alanhdu) in [https://github.com/charliermarsh/ruff/pull/4052](https://togithub.com/charliermarsh/ruff/pull/4052) - \[`flake8-import-conventions`] Implement new rule `ICN003` to ban `from ... import ...` for selected modules by [@​edgarrmondragon](https://togithub.com/edgarrmondragon) in [https://github.com/charliermarsh/ruff/pull/4040](https://togithub.com/charliermarsh/ruff/pull/4040) - \[`pylint`] Implement PLE0302 `unexpected-special-method-signature` by [@​mccullocht](https://togithub.com/mccullocht) in [https://github.com/charliermarsh/ruff/pull/4075](https://togithub.com/charliermarsh/ruff/pull/4075) - \[`pep8-naming`] Ignore `N815` for `TypedDict` fields by [@​JonathanPlasse](https://togithub.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4066](https://togithub.com/charliermarsh/ruff/pull/4066) ##### Bug Fixes - Avoid `PYI015` for valid default value without annotation by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4043](https://togithub.com/charliermarsh/ruff/pull/4043) - Avoid infinite-propagation of inline comments when force-splitting imports by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4074](https://togithub.com/charliermarsh/ruff/pull/4074) - Fix SIM222 and SIM223 false positives and auto-fix by [@​JonathanPlasse](https://togithub.com/JonathanPlasse) in [https://github.com/charliermarsh/ruff/pull/4063](https://togithub.com/charliermarsh/ruff/pull/4063) - Unify positional and keyword arguments when checking for missing arguments in docstring by [@​evanrittenhouse](https://togithub.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4067](https://togithub.com/charliermarsh/ruff/pull/4067) - Avoid `RUF008` if field annotation is immutable by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4039](https://togithub.com/charliermarsh/ruff/pull/4039) - Increment priority should be (branch-local, global) by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4070](https://togithub.com/charliermarsh/ruff/pull/4070) - Ignore `ClassVar` annotation for `RUF008`, `RUF009` by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4081](https://togithub.com/charliermarsh/ruff/pull/4081) - Support --fix in watch mode by [@​evanrittenhouse](https://togithub.com/evanrittenhouse) in [https://github.com/charliermarsh/ruff/pull/4035](https://togithub.com/charliermarsh/ruff/pull/4035) ##### New Contributors - [@​alanhdu](https://togithub.com/alanhdu) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4052](https://togithub.com/charliermarsh/ruff/pull/4052) - [@​pronoym99](https://togithub.com/pronoym99) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4055](https://togithub.com/charliermarsh/ruff/pull/4055) - [@​Secrus](https://togithub.com/Secrus) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4085](https://togithub.com/charliermarsh/ruff/pull/4085) - [@​madkinsz](https://togithub.com/madkinsz) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4084](https://togithub.com/charliermarsh/ruff/pull/4084) - [@​mccullocht](https://togithub.com/mccullocht) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4075](https://togithub.com/charliermarsh/ruff/pull/4075) **Full Changelog**: astral-sh/ruff@v0.0.262...v0.0.263 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/allenporter/pyrainbird). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS41OC4yIiwidXBkYXRlZEluVmVyIjoiMzUuNTguMiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
pytest.raises(Exception)
has the same problem asself.assertRaises(Exception)
, and so we should also raise a lint error when people use it. This matches the upstream flake8-bugbear behavior (see PyCQA/flake8-bugbear#169).This makes
with pytest.raises(Exception)
a lint failure, although it leavespytest.raises(Exception, match="<REGEX>")
alone (since that corresponds to theassertRaisesRegex
.