Skip to content

Commit 93c5d40

Browse files
cliffhallclaude
andcommitted
fix: match pytest rerun marks applied without a decorator
Copilot round 8 on #4920: `pytestmark = pytest.mark.flaky(...)` and `marks=pytest.mark.retries(...)` apply the same marks as the decorator form, so the guard matches `pytest.mark.flaky` / `pytest.mark.retries` anywhere. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent 7fd3201 commit 93c5d40

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎scripts/verify-no-test-retries.mjs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ export const RULES = [
9292
{
9393
id: "pytest-flaky-marker",
9494
files: /\.py$/,
95-
pattern: /@(?:pytest\.mark\.)?flaky\b|@pytest\.mark\.retries\b/,
95+
// `pytest.mark.<x>` anywhere, since a mark is also applied without a
96+
// decorator (`pytestmark = …`, `marks=…`); the bare `@flaky` import form.
97+
pattern: /\bpytest\.mark\.(?:flaky|retries)\b|@flaky\b/,
9698
why: "pytest's flaky marker",
9799
},
98100
];

0 commit comments

Comments
 (0)