monkeypatch.setattr
started failing in Pytest 8.1.2 (setuptools CI)
#12254
Labels
plugin: monkeypatch
related to the monkeypatch builtin plugin
type: bug
problem that needs to be addressed
Prior to 8.1.2 the following statement executed without raising an exception (8.0.2) in the setuptools CI, but now it started failing (8.1.2):
/home/runner/work/setuptools/setuptools/setuptools/tests/test_build_ext.py:141
The error message does not make much sense to me:
Because:
setuptools.command.build_ext
is defined as a module, not an attribute ofsetuptools.command
setuptools.command.build_ext
module does define abuild_ext
class. But alsosetuptools.command.build_ext.build_ext
should have nothing to do with monkeypatchingsetuptools.command.build_ext.use_stubs
...In the same workflow run, we also have other similar errors (e.g.
AttributeError: module 'setuptools.command' has no attribute 'build_clib'
)- [x] output of `pip list` from the virtual environment you are using
For the tox output:
Unfortunately I was not able to simplify the reproducer.
I tried to create a minimal example with
monkeypatch
and nested modules but all works fine:The text was updated successfully, but these errors were encountered: