This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
importunittest
classPEP3131Test(unittest.TestCase):
deftest_valid(self):
classT:
ä=1
µ=2# this is a compatibility character
蟒=3
x󠄀=4
self.assertEqual(getattr(T,"\xe4"),1)
self.assertEqual(getattr(T,"\u03bc"),2)
self.assertEqual(getattr(T,'\u87d2'),3)
self.assertEqual(getattr(T,'x\U000E0100'),4)
deftest_non_bmp_normalized(self):
𝔘𝔫𝔦𝔠𝔬𝔡𝔢=1
self.assertIn("Unicode",dir())
deftest_invalid(self):
try:
fromtestimportbadsyntax_3131
exceptSyntaxErroraserr:
self.assertEqual(str(err),
"invalid character '€' (U+20AC) (badsyntax_3131.py, line 2)")