Skip to content

test: qiskit validation_helpers.py incorrectly collected as a test — fails with missing flake8-qiskit-migration #683

@planetf1

Description

@planetf1

docs/examples/instruct_validate_repair/qiskit_code_validation/validation_helpers.py is being collected and executed by pytest as an example, when it is a helper module not intended to be run directly. It fails immediately because flake8-qiskit-migration is not a standard dependency:

ImportError: flake8-qiskit-migration is required for this example.
Run with: uv run docs/examples/instruct_validate_repair/qiskit_code_validation/qiskit_code_validation.py

To reproduce:

uv sync --all-extras --all-groups
uv run pytest --durations=0 --ignore=test/formatters/granite/test_intrinsics_formatters.py -v

Environment:

  • MacBook M1 (Apple Silicon, macOS)
  • Python 3.12.8

Note: The main entry point qiskit_code_validation.py is correctly marked with # pytest: skip. The helper module alongside it is not, so it falls through to collection.

Suggested fix: Add # pytest: skip to the top of validation_helpers.py — it is not a runnable script and should never be collected.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions