-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
topic: rewriterelated to the assertion rewrite mechanismrelated to the assertion rewrite mechanismtype: bugproblem that needs to be addressedproblem that needs to be addressed
Description
As discovered in pypa/setuptools#1038, when the following is true:
- a plugin (such as
backports.unittest_mock
) is a namespace package, - that namespace package is defined using the recommended pkg_util technique,
- that plugin is used by the test environment, and
- something in the test suite attempts to import another package in that namespace,
py.test
will attempt to rewrite the namespace package module, which will cause errors in sandboxed environments where writing outside of the prescribed directory is disallowed.
It's not obvious to me that this is a bug in pytest, and I admit, the factors are highly specialized.
Still, since namespace packages using the pkg_resources technique don't cause pytest to rewrite that package, I'd like to consider if this issue can be addressed by pytest detecting and honoring these namespace packages and excluding them from needing rewriting.
I have a minimal test project I will be pushing shortly demonstrating the issue.
Metadata
Metadata
Assignees
Labels
topic: rewriterelated to the assertion rewrite mechanismrelated to the assertion rewrite mechanismtype: bugproblem that needs to be addressedproblem that needs to be addressed