use patch context manager instead of decorator because the decorator 'leaks' metadata onto the function