Avoid patching code in tests.