Skip to content

Exempt unittest context methods for SIM115 rule#16439

Merged
AlexWaygood merged 1 commit intoastral-sh:mainfrom
adamchainz:adamchainz/sim115
Feb 28, 2025
Merged

Exempt unittest context methods for SIM115 rule#16439
AlexWaygood merged 1 commit intoastral-sh:mainfrom
adamchainz:adamchainz/sim115

Conversation

@adamchainz
Copy link
Copy Markdown
Contributor

Summary

Exempt calls to the three context methods in unittest, allowing some false positives where identical method names are used.

Closes #16438.

Test Plan

Added test cases to Python file, updated snapshots.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 28, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Copy Markdown
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Comment thread crates/ruff_linter/resources/test/fixtures/flake8_simplify/SIM115.py Outdated
co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@AlexWaygood AlexWaygood added bug Something isn't working rule Implementing or modifying a lint rule labels Feb 28, 2025
Copy link
Copy Markdown
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@AlexWaygood AlexWaygood merged commit 5ca6cc2 into astral-sh:main Feb 28, 2025
@adamchainz adamchainz deleted the adamchainz/sim115 branch February 28, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SIM115 should exempt unittest.TestCase.enterContext() and enterClassContext()

2 participants