You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
It looks like updating to Mock 3.8 has caused some perf regressions. There's some known issues called out here:https://bugs.python.org/issue38895 - this:
* Don't use `inspect` to get `spec` and `spec_sec` - instead now we fully spell out the signature and use the args directly.
* provides a variation on not reflecting over all async methods on creation. The `_spec_asyncs` list still exists, but it is just not populated by default. Instead we'll consult it or check if the function is async.
* Don't create the mock code object on instantiation of the `AsyncMock` - this is actually a huge portion of the cost of creating `AsyncMock` objects.
* Avoid quadruple `self._mock_set_magics()` calls. This is actually done in the `MagicMixin` class so there's no need to do it in the `AsyncMagicMixin`
Reviewed By: carljm
Differential Revision: D35118477
fbshipit-source-id: 38779e0
0 commit comments