I have some code which is used in a unit test. However, the library it loads requires some data which isn't actually required for the nose-test, because that data is mocked out by the unit test. I'd like to protect the file-reads in the library so that they don't get called in the case of a nose test.
Is there an easy way to do this?
I can probably do something with sys.modules, or the initial command line, but I'd prefer something more elegant, if it exists.