diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-05-22 00:57:02 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-05-22 00:57:02 (GMT) |
commit | 948ee7a7c83f0515236ef3e03ddee3852c7bbfe1 (patch) | |
tree | 093d248f6b3d19756d69ac5d08933b37ae883ea3 | |
parent | a4e4ef1cea957795b45e9956a6fc6eec76ceebaf (diff) | |
download | cpython-948ee7a7c83f0515236ef3e03ddee3852c7bbfe1.zip cpython-948ee7a7c83f0515236ef3e03ddee3852c7bbfe1.tar.gz cpython-948ee7a7c83f0515236ef3e03ddee3852c7bbfe1.tar.bz2 |
use more specific asserts in test_opcode
-rw-r--r-- | Lib/test/test_opcodes.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/test/test_opcodes.py b/Lib/test/test_opcodes.py index 88ec1f5..d7d1673 100644 --- a/Lib/test/test_opcodes.py +++ b/Lib/test/test_opcodes.py @@ -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(): |