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

Method test_isprintable_invariant

Lib/test/test_str.py:864–870  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

862
863 @support.requires_resource('cpu')
864 def test_isprintable_invariant(self):
865 for codepoint in range(sys.maxunicode + 1):
866 char = chr(codepoint)
867 category = unicodedata.category(char)
868 self.assertEqual(char.isprintable(),
869 category[0] not in ('C', 'Z')
870 or char == ' ')
871
872 def test_surrogates(self):
873 for s in ('a\uD800b\uDFFF', 'a\uDFFFb\uD800',

Callers

nothing calls this directly

Calls 2

isprintableMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected