Kai Grossjohann <[EMAIL PROTECTED]> wrote:
> I wrote a test case that depends on a certain file existing in the
> environment.
In theory, unit tests should not depend on any external factors, but
we all know the difference between theory and practice, right?
> So, I guess I should test that the file exists in the
> setUp method. But what if it doesn't exist? How do I fail in that case?
def setUp (self):
try:
open ("myEssentialTestFile")
except IOError:
self.fail ("Hey, dummy, myEssentialTestFile is missing!")
--
http://mail.python.org/mailman/listinfo/python-list