19 Aug
2005
19 Aug
'05
8:49 a.m.
Hi all. I'm trying to write a ZopeTestCase where I can check if the import of a missing module is catch or no. I would therefore test something like this: def testImportIsCaught(self): import sys oo_path = filter(lambda x: 'program' in x, sys.path) sys.path.remove(oo_path[0]) ZopeTestCase.installProduct('PAFlow') What I'm doing here is to remove the path where the openoffice support is in the system, and then I try to install the product. If the exception import is caught, this should not raise an exception. The problem is that if I run all the tests, I will end with my product already installed, and, therefore, the test won't be run correctly. Do anyone has any suggestion? Regards Marco