Skip to content

QA-PY-108 — Hardcoded URL in test ​

← Back to the rule catalog

Generated from the rule registry. Get the same detail from the CLI with mjolnir explain QA-PY-108.

FieldValue
Severitywarning
Confidencehigh
Tierquarantine
Measured FP rate0% (n=16)
Evidence levelE2
QA impactTest hygiene debt (HYGIENE)
False-positive risk (author estimate)low
Autofix availableno
Languagespython
Frameworkspytest
Detection strategyLEXICAL
Introduced inv0.4.0

Why this fails in production ​

Absolute URLs break when environments change and can hit production by accident from a CI runner.

What gets flagged (real detector output) ​

Hardcoded URL: `goto("https://app.example.com/dashboard"`.

Example from this rule's own must-fire fixture: tests/fixtures/QA-PY-108/must-fire/test_nav.py

The fix ​

Use --base-url / base_url fixture, or os.environ[...].

Confirmed NOT to fire on the corresponding clean pattern ​

Verified against tests/fixtures/QA-PY-108/must-not-fire/test_nav.py — a legitimate, similar-looking pattern this rule correctly leaves alone.

Corpus-measured false-positive risk ​

Real occurrence counts from npm run corpus:audit against actively-maintained OSS repos — reproduce yourself, don't just trust this table (see the false-positive audit):

RepoOccurrences
positive-fixtures9

Released under the MIT License.