Skip to content

Commit

Permalink
The syntax of with assertRaises changes across python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
sbuss committed Jul 30, 2015
1 parent 9b49a5f commit 5e3a231
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_bip32.py
Expand Up @@ -325,10 +325,14 @@ def test_child_too_big(self):

def test_no_prime_children_of_public_copy(self):
pub = self.wallet.public_copy()
with self.assertRaises(ValueError) as exc:
try:
pub.get_child(0, is_prime=True)
self.assertIn("prime child", exc.exception.message)
self.assertIn("private key", exc.exception.message)
assert False
except ValueError as e:
err_msg = str(e)
self.assertTrue(
"Cannot compute a prime child without a private key"
in err_msg)
self.assertTrue(pub.get_child(0))

def test_path_bigger_than_boundary(self):
Expand Down

0 comments on commit 5e3a231

Please sign in to comment.