Mocking pipelines

Hey ppl, I am writing some unit tests on top of transformers and need to mock/patch pipeline function! However, it seems like pipeline is somehow immune to patching!? Has anyone encountered similar issues?
BR, Vladimir