Skip to content

UsageError in package that contains pytest_plugins module #3899

@kohr-h

Description

@kohr-h

When running pytest --doctest-modules on a package that contains a pytest plugin, pytest errors out and produces a pretty long stacktrace. The code that triggers the error is the _get_plugin_specs_as_list function that receives a module object instead of a list or a string.

The behavior is OS-independent as far as I can tell, but affects only pytest 3.7+ ; pytest 3.6.4 works fine. Also note that the error is only triggered when doc-testing the specific subpackage that contains the plugin.

For proper context, we have the following directory structure:

odl
 |
 |- util --
 |        |- pytest_plugins.py
 |        |- ...
 | - ...

The error is triggered by pytest --doctest-modules odl/util.

The full backtrace is here.
Link to the subpackage: https://github.com/odlgroup/odl/tree/master/odl/util

Edit: Updated pytest versions affected

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions