Skip to content

PYTEST_PLUGINS does not mark files for rewriting #2185

Closed
@nicoddemus

Description

@nicoddemus

Minimal example:

# contents of plugin.py
# can be an empty file

# contents of test_foo.py
import plugin

pytest_plugins = ['plugin']

def test():
    pass

Setting the environment variable PYTEST_PLUGINS=plugin to the test's directory and configuring PYTHONPATH so the plugin module can be imported, pytest will warn about plugin already been imported and couldn't be re-written:

$ pytest -q
.
=========================== pytest-warning summary ============================
WP1 None Module already imported so can not be re-written: plugin
1 passed, 1 pytest-warnings in 0.01 seconds

Pytest should consider PYTEST_PLUGINS automatically for rewriting.

Metadata

Metadata

Assignees

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