-
Notifications
You must be signed in to change notification settings - Fork 74
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
Yappi 3.12 AttributeError: _mock_methods
when using MagicMock
#172
Comments
I'm seeing this when I use yappi in combination with unittest.mock and Python 3.12. Removing any of those three elements fixes the issue. Here's a repro: from unittest import mock
import yappi
if __name__ == "__main__":
yappi.start()
mock.MagicMock()
yappi.stop() Traceback:
|
Summary: A few changes were needed to enable Python 3.12 in tests: * I unpinned the pyfakefs version. * I removed Yappi entirely. Yappi was used to print basic profiling output on test runtime when tests timed out. It seems to be incompatible with unittest.mock with Python 3.12; see here: sumerc/yappi#172 I don't think anyone was using Yappi's output. Note: This previously did not work when facebook#2349 was put in due to an issue with pyzmq, but since then there have been new pyzmq releases, which added 3.12 support. Differential Revision: D57815360
Summary: A few changes were needed to enable Python 3.12 in tests: * I unpinned the pyfakefs version. * I removed Yappi entirely. Yappi was used to print basic profiling output on test runtime when tests timed out. It seems to be incompatible with unittest.mock with Python 3.12; see here: sumerc/yappi#172 I don't think anyone was using Yappi's output. Note: This previously did not work when facebook#2349 was put in due to an issue with pyzmq, but since then there have been new pyzmq releases, which added 3.12 support. Differential Revision: D57815360
Summary: Pull Request resolved: #2478 A few changes were needed to enable Python 3.12 in tests: * I unpinned the pyfakefs version. * I removed Yappi entirely. Yappi was used to print basic profiling output on test runtime when tests timed out. It seems to be incompatible with unittest.mock with Python 3.12; see here: sumerc/yappi#172 I don't think anyone was using Yappi's output. Note: This previously did not work when #2349 was put in due to an issue with pyzmq, but since then there have been new pyzmq releases, which added 3.12 support. Reviewed By: Balandat Differential Revision: D57815360 fbshipit-source-id: 4c40fcde516034e1c6065e45c37f9d3110bd2b78
@sumerc I see an AttributeError as well on Python 3.12. It is easy to reproduce:
Profile on the command line with Traceback:
|
AttributeError: _mock_methods
when using MagicMock
I will look into this! |
My program fails when trying to profile using yappi through 3.12 (works fine with cProfile)
The text was updated successfully, but these errors were encountered: