Skip to content

Commit

Permalink
Fixed Python 2.6 unittest assertRaises takes at least 3 arguments.
Browse files Browse the repository at this point in the history
TypeError: failUnlessRaises() takes at least 3 arguments (2 given)
  • Loading branch information
ifduyue committed Dec 10, 2015
1 parent 0a05d33 commit 447b8e6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ def test_hex_encode(self):
self.assertEqual(binascii.b2a_hex(enc), hexenc)

def test_decrypt_invalid(self):
with self.assertRaises(ValueError):
def f():
for i in range(1024):
key = os.urandom(16)
data = os.urandom(i * 8)

xxtea.decrypt(data, key)
xxtea.decrypt(data, key=key)

self.assertRaises(ValueError, f)


if __name__ == '__main__':
Expand Down

0 comments on commit 447b8e6

Please sign in to comment.