Skip to content

Commit 3326f05

Browse files
adamtheturtleclaude
andcommitted
Use setdefault to collect patterns per test
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 170afd7 commit 3326f05

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

ci/test_custom_linters.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,7 @@ def test_tests_collected_once(request: pytest.FixtureRequest) -> None:
103103
for pattern in ci_patterns:
104104
tests = _tests_from_pattern(ci_pattern=pattern)
105105
for test in tests:
106-
if test in tests_to_patterns:
107-
tests_to_patterns[test].add(pattern)
108-
else:
109-
tests_to_patterns[test] = {pattern}
106+
tests_to_patterns.setdefault(test, set()).add(pattern)
110107

111108
for test_name, patterns in tests_to_patterns.items():
112109
message = (

0 commit comments

Comments
 (0)