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