Skip to content

Pytest cannot import the src-layout package #85

@saxon134

Description

@saxon134

The project uses a src layout (packages = ["src/globalrouter"]), but the pytest config only sets testpaths and does not add src to the import path. In a fresh checkout, python -m pytest -q fails during collection with ModuleNotFoundError: No module named 'globalrouter'; PYTHONPATH=src python -m pytest -q passes. Add pythonpath = ["src"] under [tool.pytest.ini_options] or make the test runner install the package before invoking pytest.

File: pyproject.toml

Line: 60

Severity: high

Summary: missing pytest pythonpath for src layout

Metadata

Metadata

Assignees

No one assigned

    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