use more specific asserts in test_opcode

This commit is contained in:
Benjamin Peterson 2008-05-22 00:57:02 +00:00
parent a4e4ef1cea
commit 948ee7a7c8
1 changed files with 10 additions and 10 deletions

View File

@ -48,12 +48,12 @@ class OpcodeTest(unittest.TestCase):
try: raise AClass, b
except BClass, v:
if v != b: self.fail("v!=b")
self.assertEqual(v, b)
else: self.fail("no exception")
try: raise b
except AClass, v:
if v != b: self.fail("v!=b AClass")
self.assertEqual(v, b)
else:
self.fail("no exception")
@ -72,35 +72,35 @@ class OpcodeTest(unittest.TestCase):
f = eval('lambda: None')
g = eval('lambda: None')
self.failIf(f == g)
self.assertNotEquals(f, g)
f = eval('lambda a: a')
g = eval('lambda a: a')
self.failIf(f == g)
self.assertNotEquals(f, g)
f = eval('lambda a=1: a')
g = eval('lambda a=1: a')
self.failIf(f == g)
self.assertNotEquals(f, g)
f = eval('lambda: 0')
g = eval('lambda: 1')
self.failIf(f == g)
self.assertNotEquals(f, g)
f = eval('lambda: None')
g = eval('lambda a: None')
self.failIf(f == g)
self.assertNotEquals(f, g)
f = eval('lambda a: None')
g = eval('lambda b: None')
self.failIf(f == g)
self.assertNotEquals(f, g)
f = eval('lambda a: None')
g = eval('lambda a=None: None')
self.failIf(f == g)
self.assertNotEquals(f, g)
f = eval('lambda a=0: None')
g = eval('lambda a=1: None')
self.failIf(f == g)
self.assertNotEquals(f, g)
def test_main():