Skip to content

[doctests] Namespace packages (PEP 420) missing, leading to errors with relative imports #3396

Description

@punitchandra

When testing packages with implicit namespace and using --doctest-module the doc test module is imported without the implicit namespace.

This causes problems as the module can gets imported with different name. Once with the proper path and once with missing the namespace.

My pytest related versions:
pytest (3.5.0)
pytest-attrib (0.1.3)
pytest-cov (2.5.1)
pytest-forked (0.2)
pytest-timeout (1.2.1)
pytest-xdist (1.22.2)

OS is Windows 7.
Please look at the example:

foo.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

plugin: doctestsrelated to the doctests builtin plugintopic: collectionrelated to the collection phasetype: bugproblem that needs to be addressed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions