mock.reset()
此函数会恢复由该 MockTracker 之前创建的所有模拟的默认行为,并将这些模拟与 MockTracker 实例解绑。解绑后,模拟仍然可以使用,但 MockTracker 实例将无法再重置它们的行为或以其他方式与它们互动。
【This function restores the default behavior of all mocks that were previously
created by this MockTracker and disassociates the mocks from the
MockTracker instance. Once disassociated, the mocks can still be used, but the
MockTracker instance can no longer be used to reset their behavior or
otherwise interact with them.】
每个测试完成后,将在测试上下文的 MockTracker 上调用此函数。如果全局 MockTracker 使用频繁,建议手动调用此函数。
【After each test completes, this function is called on the test context's
MockTracker. If the global MockTracker is used extensively, calling this
function manually is recommended.】