MCPcopy Index your code
hub / github.com/python/cpython / assertFactoryError

Method assertFactoryError

Lib/test/test_ipaddress.py:885–890  ·  view source on GitHub ↗

Ensure a clean ValueError with the expected message

(self, factory, kind)

Source from the content-addressed store, hash-verified

883class FactoryFunctionErrors(BaseTestCase):
884
885 def assertFactoryError(self, factory, kind):
886 """Ensure a clean ValueError with the expected message"""
887 addr = "camelot"
888 msg = '%r does not appear to be an IPv4 or IPv6 %s'
889 with self.assertCleanError(ValueError, msg, addr, kind):
890 factory(addr)
891
892 def test_ip_address(self):
893 self.assertFactoryError(ipaddress.ip_address, "address")

Callers 3

test_ip_addressMethod · 0.95
test_ip_interfaceMethod · 0.95
test_ip_networkMethod · 0.95

Calls 2

assertCleanErrorMethod · 0.80
factoryFunction · 0.50

Tested by

no test coverage detected