SKY-L044 · Logic and resilience
Test runs no project code
A test in which every name it reads is one the test bound itself, or a pure builtin such as len, sum or sorted. The test builds its own values and asserts on them, or re-implements the logic it claims to check, so nothing from the project is ever called.
- Languages
- Python
- Quality gate
- counted toward the gate limits (full and diff scans)
- Finding type
- review
Why it matters
The test passes whatever the project does. It shows up as a green test named after a feature, so a reader believes the feature is covered when no line of it runs. Coding agents write this kind of test when they cannot get a real one to pass.
What Skylos flags
from billing.providers import infer_provider def test_provider_inferred_from_claude_model(): model = "claude-3-7-sonnet-latest" if "claude" in model.lower(): provider = "anthropic" else: provider = "openai" assert provider == "anthropic" def test_provider_inferred_from_gpt_model(): assert infer_provider("gpt-4.1") == "openai"What Skylos leaves alone
from billing.providers import DEFAULT_MODEL, infer_provider def test_provider_inferred_from_claude_model(): assert infer_provider("claude-3-7-sonnet-latest") == "anthropic" def test_default_model_is_supported(): model = DEFAULT_MODEL assert model.startswith("gpt-")Why Skylos leaves it alone
The first test calls infer_provider; the second reads DEFAULT_MODEL, a name imported from the project. Either one can change the result, so neither test is reported.
How Skylos decides
- Runs with
--quality. Looks only at tests pytest or unittest would collect: module-leveltest*functions andtest*methods of collectedTest*classes or provenunittest.TestCasesubclasses, using the project's pytest settings. Skipped andxfailtests are left out. - Reports the test when every name it reads is bound inside the test or is a builtin from a fixed list (
len,sum,sorted,str,int,isinstance,range, ...) that still resolves to the builtin in that scope. - Leaves the test alone when it takes a parameter (a fixture), has a decorator, imports anything, reads a module-level name, reads a
selfattribute other than a standardunittestassertion method, defines a nested function or class, raises, awaits or yields. - A test with no assertion at all is also left alone when fixtures, setup hooks or a
conftest.pymay supply its checks. - Empty bodies stay SKY-L041 and literal-only assertions such as
assert Truestay SKY-L040, so one test is not reported twice.
How to fix it
Call the code under test and assert on what it returns. Delete the copy of the logic from the test.
from billing.providers import infer_provider def test_provider_inferred_from_claude_model():Removed: model = "claude-3-7-sonnet-latest"Removed: if "claude" in model.lower():Removed: provider = "anthropic"Removed: else:Removed: provider = "openai"Removed: assert provider == "anthropic"Added: assert infer_provider("claude-3-7-sonnet-latest") == "anthropic" def test_provider_inferred_from_gpt_model(): assert infer_provider("gpt-4.1") == "openai"When it can be wrong
- A test of Python itself, or of a pure builtin, is reported: it really runs no project code. Move it out of the project's suite or suppress it.
- It misses a test that calls project code and then ignores the result, or asserts the wrong value. SKY-L046 covers a result that is never checked;
skylos done(SKY-A120) runs the tests to find lines no test would notice breaking.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Put the marker on the
defline of the test.Python def test_sorting_is_stable(): # skylos: ignore[SKY-L044] documents sorted()[tool.skylos] ignore = ["SKY-L044"]turns the rule off for the project.