Silence a couple of -3 warnings

This commit is contained in:
Ezio Melotti 2010-02-02 15:12:42 +00:00
parent 5d62cfe070
commit 0ac4d4c82d
1 changed files with 5 additions and 2 deletions

View File

@ -3056,7 +3056,7 @@ class Test_Assertions(TestCase):
try:
self.assertRaises(KeyError, lambda: None)
except self.failureException as e:
self.assertIn("KeyError not raised", e)
self.assertIn("KeyError not raised", e.args)
else:
self.fail("assertRaises() didn't fail")
try:
@ -3073,7 +3073,7 @@ class Test_Assertions(TestCase):
with self.assertRaises(KeyError):
pass
except self.failureException as e:
self.assertIn("KeyError not raised", e)
self.assertIn("KeyError not raised", e.args)
else:
self.fail("assertRaises() didn't fail")
try:
@ -3591,6 +3591,9 @@ class TestDiscovery(TestCase):
def __eq__(self, other):
return self.path == other.path
# Silence py3k warning
__hash__ = None
loader._get_module_from_name = lambda name: Module(name)
def loadTestsFromModule(module, use_load_tests):
if use_load_tests: