-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mocking import_module() function causes all subsequent mocks to fail silently #98771
Comments
I'm not sure if this is a bug, you're mocking This worked in older versions of Python because those used a custom implementation of this functionality instead of relying on a public API for this. |
I agree this isn't a bug for the reasons Ronald outlined. Thanks for at least reporting this, @miguelgrinberg ! |
* Ensure tox envs that run tests depend on cmd extra * Fix test_report_gives_package_version on Python 3.11+ Fixes #94. See python/cpython#98771 and #94 (comment). * Add missing newline at end of pyct/tests/test_report.py * Test Python 3.11 and add it to the trove classifiers
Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
Bug report
This is a 3.11 regression. Here is the simplest example I could come up with to demonstrate the issue:
Here is the output under several Python versions:
In case it helps, I've been looking through the commit list for mock.py and found that ab7fcc8 is the first change that shows the broken behavior.
Your environment
I'm using CPython 3.11.0 on Intel Mac.
The text was updated successfully, but these errors were encountered: