aboutsummaryrefslogtreecommitdiff
path: root/test_ipaddress.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2015-07-13 04:17:51 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2015-07-13 04:17:51 +0200
commitb65c191f86498b98d0265c036cc2315d612ff4e2 (patch)
tree07f63b685f167ba92db1ecfbc044216979bdc24f /test_ipaddress.py
parentdf6c08e5b374ffd8c8e86c16268552a66c117895 (diff)
downloadipaddress-b65c191f86498b98d0265c036cc2315d612ff4e2.tar.gz
[2.6] Switch back to old-school assertRaises style
Diffstat (limited to 'test_ipaddress.py')
-rw-r--r--test_ipaddress.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/test_ipaddress.py b/test_ipaddress.py
index 7478a96..c78c863 100644
--- a/test_ipaddress.py
+++ b/test_ipaddress.py
@@ -818,13 +818,11 @@ class IpaddrUnitTest(unittest.TestCase):
# strict=True and host bits set
ip = ipaddress.IPv6Address('2001:db8::1')
- with self.assertRaises(ValueError):
- ipaddress.IPv6Network(('2001:db8::1', 96))
- with self.assertRaises(ValueError):
- ipaddress.IPv6Network((
- 42540766411282592856903984951653826561, 96))
- with self.assertRaises(ValueError):
- ipaddress.IPv6Network((ip, 96))
+ self.assertRaises(ValueError, ipaddress.IPv6Network, ('2001:db8::1', 96))
+ self.assertRaises(
+ ValueError, ipaddress.IPv6Network,
+ (42540766411282592856903984951653826561, 96))
+ self.assertRaises(ValueError, ipaddress.IPv6Network, (ip, 96))
# strict=False and host bits set
net = ipaddress.IPv6Network('2001:db8::/96')
self.assertEqual(ipaddress.IPv6Network(('2001:db8::1', 96),