Skip to main content

Module lint

Module lint 

Source
Expand description

Integration-test lints (issue #19; rules #48–#52) — the integration lint command.

A lint here is a deterministic style/mechanism check on test code, as opposed to the structural location / coverage rules. This module hosts the mocking mechanism & style lints; more lints will join them under the same command.

Detection is AST-based: each Python test file is parsed with rustpython_parser and the tree is walked.

Implemented lints:

  • no-monkeypatch (#49): a test/fixture function that declares the monkeypatch parameter (pytest’s fixture). Patch with unittest.mock wrapped in a pytest.fixture instead.

Structs§

Violation
A single lint violation found in a test file.

Functions§

find_violations
Scan the Python test files under root and return every lint violation, sorted by (file, line) for deterministic output.