[Python-checkins] cpython (merge 3.4 -> default): #20815: small readability improvements in ipaddress tests.

r.david.murray python-checkins at python.org
Sun Oct 12 21:17:53 CEST 2014


https://hg.python.org/cpython/rev/4c9d27eef892
changeset:   93008:4c9d27eef892
parent:      93005:02c9c3204a04
parent:      93007:27a02eb9273f
user:        R David Murray <rdmurray at bitdance.com>
date:        Sun Oct 12 15:17:44 2014 -0400
summary:
  #20815: small readability improvements in ipaddress tests.

files:
  Lib/test/test_ipaddress.py |  13 +++++++++----
  1 files changed, 9 insertions(+), 4 deletions(-)


diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py
--- a/Lib/test/test_ipaddress.py
+++ b/Lib/test/test_ipaddress.py
@@ -10,6 +10,7 @@
 import operator
 import ipaddress
 
+
 class BaseTestCase(unittest.TestCase):
     # One big change in ipaddress over the original ipaddr module is
     # error reporting that tries to assume users *don't know the rules*
@@ -52,17 +53,18 @@
     def assertAddressError(self, details, *args):
         """Ensure a clean AddressValueError"""
         return self.assertCleanError(ipaddress.AddressValueError,
-                                       details, *args)
+                                     details, *args)
 
     def assertNetmaskError(self, details, *args):
         """Ensure a clean NetmaskValueError"""
         return self.assertCleanError(ipaddress.NetmaskValueError,
-                                details, *args)
+                                     details, *args)
 
     def assertInstancesEqual(self, lhs, rhs):
         """Check constructor arguments produce equivalent instances"""
         self.assertEqual(self.factory(lhs), self.factory(rhs))
 
+
 class CommonTestMixin:
 
     def test_empty_address(self):
@@ -115,6 +117,7 @@
         assertBadLength(3)
         assertBadLength(5)
 
+
 class CommonTestMixin_v6(CommonTestMixin):
 
     def test_leading_zeros(self):
@@ -195,7 +198,7 @@
     def test_empty_octet(self):
         def assertBadOctet(addr):
             with self.assertAddressError("Empty octet not permitted in %r",
-                                          addr):
+                                         addr):
                 ipaddress.IPv4Address(addr)
 
         assertBadOctet("42..42.42")
@@ -443,6 +446,7 @@
 class InterfaceTestCase_v4(BaseTestCase, NetmaskTestMixin_v4):
     factory = ipaddress.IPv4Interface
 
+
 class NetworkTestCase_v4(BaseTestCase, NetmaskTestMixin_v4):
     factory = ipaddress.IPv4Network
 
@@ -496,9 +500,11 @@
         assertBadNetmask("::1", "pudding")
         assertBadNetmask("::", "::")
 
+
 class InterfaceTestCase_v6(BaseTestCase, NetmaskTestMixin_v6):
     factory = ipaddress.IPv6Interface
 
+
 class NetworkTestCase_v6(BaseTestCase, NetmaskTestMixin_v6):
     factory = ipaddress.IPv6Network
 
@@ -608,7 +614,6 @@
         self.assertRaises(TypeError, v6net.__gt__, v4net)
 
 
-
 class IpaddrUnitTest(unittest.TestCase):
 
     def setUp(self):

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list