Skip to main content

TEST003-skipped — Skipped or Ignored Tests

Dimension: TestSmell Default severity: Info Languages: All Last reviewed: 2026-05-05

What it detects​

Detects skip / ignore markers in test source files. One finding is emitted per marker, located at the byte range of the matched text on that line.

Recognised markers​

The analyzer uses a single compiled regex with the (?m) multiline flag to scan the entire file source in one pass:

Rust​

MarkerExample
#[ignore]#[ignore]
#[ignore = "…"]#[ignore = "not yet implemented"]

Python​

MarkerExample
@pytest.mark.skip@pytest.mark.skip
@pytest.mark.skip(reason="…")@pytest.mark.skip(reason="slow")
@unittest.skip@unittest.skip
@skip@skip

JavaScript / TypeScript​

MarkerExample
it.skip(it.skip("should …", () => { … })
describe.skip(describe.skip("suite …", () => { … })
xit(xit("should …", () => { … })
xdescribe(xdescribe("suite …", () => { … })
test.skip(test.skip("should …", () => { … })

Why it matters​

Skipped tests that are never re-enabled become dead code. They give a false impression of coverage and often refer to bugs or features that were never finished. Long-lived skipped tests rot silently as the code they target changes.

Configuration​

No configuration knobs. All markers are always detected.

Example — flagged​

Rust:

#[test]
#[ignore]
fn test_plain_ignore() { assert_eq!(1, 1); }

#[test]
#[ignore = "not yet implemented"]
fn test_ignore_with_reason() { assert_eq!(2, 2); }

Python:

@pytest.mark.skip
def test_with_pytest_skip():
assert True

@unittest.skip
def test_with_unittest_skip():
assert True

JavaScript:

it.skip("should do something", () => {
expect(true).toBe(true);
});

xit("should do something else", () => {
expect(true).toBe(true);
});

Fix guidance​

  • Re-enable the test and fix the underlying issue it was guarding.
  • If the test is permanently obsolete, delete it so it stops appearing in coverage reports.
  • Document why a test is skipped with a tracking issue number in the skip reason string (e.g. #[ignore = "issue #123: flaky on CI"]).

Implementation​

References​