I'm currently trying to write a unittest which checks whether or not a function has written an error log. For testing purposes, the error log is to be written to a temporary directory but I am unsure how I can re-route the location of a write() call using unittest.mock.
Any ideas how to go about this?