I'm seeing some weird test leakage with MockRPCProxy: if one test flips fallback_to_call and then calls reset(), the next test still behaves as if that flipped fallback setting is in effect. I also noticed unmatched calls behave differently depending on whether I call the proxy directly or go through proxy.some_service.some_method, even with the same fallback setup. In a couple of tests I only want one named service to use the real RPC fallback, but I don't see a public way to mark just that service.
Expected outcomes
MockRPCProxy.reset(keep_routings=False) restores fallback_to_call to the value that was provided when the MockRPCProxy instance was constructed.
Resetting a MockRPCProxy continues to clear per-test call state and service fallback allowances unless the existing routing-preservation option says otherwise.
Unmatched direct calls and unmatched attribute-style service calls honor the same current fallback_to_call setting.
When fallback_to_call is disabled, unmatched calls through either supported call style do not fall through to the real RPC call path.
MockRPCProxy.add_service_to_whitelist(service) is available as a public API for allowing a named service to use real RPC fallback.
Calling MockRPCProxy.add_service_to_whitelist(service) enables fallback behavior for the proxy and limits that fallback to the named service or services that have been explicitly allowed.
Implementation notes
The concrete storage, propagation mechanism, and validation location are up to the implementer. Preserve the existing public behavior of MockRPCProxy routing, dummy responses, matched calls, and reset options except where the outcomes above require changed behavior.