summaryrefslogtreecommitdiffstats
path: root/Lib/unittest.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest.py')
-rw-r--r--Lib/unittest.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/unittest.py b/Lib/unittest.py
index c3faa10..480e825 100644
--- a/Lib/unittest.py
+++ b/Lib/unittest.py
@@ -432,16 +432,17 @@ class TestLoader:
for part in parts:
obj = getattr(obj, part)
+ import unittest
if type(obj) == types.ModuleType:
return self.loadTestsFromModule(obj)
- elif type(obj) == types.ClassType and issubclass(obj, TestCase):
+ elif type(obj) == types.ClassType and issubclass(obj, unittest.TestCase):
return self.loadTestsFromTestCase(obj)
elif type(obj) == types.UnboundMethodType:
return obj.im_class(obj.__name__)
elif callable(obj):
test = obj()
- if not isinstance(test, TestCase) and \
- not isinstance(test, TestSuite):
+ if not isinstance(test, unittest.TestCase) and \
+ not isinstance(test, unittest.TestSuite):
raise ValueError, \
"calling %s returned %s, not a test" % (obj,test)
return test