Skip to content

Pytest fixture direct import inspection

Pytest fixture direct import inspection reports fixture functions imported directly into conftest.py.

How to use it

Open a conftest.py file that imports fixture functions directly. BetterPy highlights imports that should be replaced with explicit plugin scoping.

When it helps

Use this inspection to keep fixture sharing explicit and avoid surprising fixture availability across test packages.

Notes

  • Prefer pytest_plugins when exposing fixtures from another module.
  • The feature is gated by the Pytest fixture direct import inspection setting under Settings | BetterPy | Testing (Pytest) | Fixture Inspections.