-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
3342e16
commit 793f7d0
Showing
1 changed file
with
14 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters