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

Method test_unregister

Lib/test/test_codecs.py:1800–1810  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1798 self.assertRaises(TypeError, codecs.register, 42)
1799
1800 def test_unregister(self):
1801 name = "nonexistent_codec_name"
1802 search_function = mock.Mock()
1803 codecs.register(search_function)
1804 self.assertRaises(TypeError, codecs.lookup, name)
1805 search_function.assert_called_with(name)
1806 search_function.reset_mock()
1807
1808 codecs.unregister(search_function)
1809 self.assertRaises(LookupError, codecs.lookup, name)
1810 search_function.assert_not_called()
1811
1812 def test_lookup(self):
1813 self.assertRaises(TypeError, codecs.lookup)

Callers

nothing calls this directly

Calls 6

assert_called_withMethod · 0.80
assert_not_calledMethod · 0.80
registerMethod · 0.45
assertRaisesMethod · 0.45
reset_mockMethod · 0.45
unregisterMethod · 0.45

Tested by

no test coverage detected