@@ -37,19 +37,15 @@ def test_safe_repr_never_broken_for_strings(x):
3737
3838
3939def test_safe_repr_regressions ():
40- # fmt: off
41- assert u"лошадь" in safe_repr (u"лошадь" )
42- # fmt: on
40+ assert "лошадь" in safe_repr ("лошадь" )
4341
4442
4543@pytest .mark .xfail (
4644 sys .version_info < (3 ,),
4745 reason = "Fixing this in Python 2 would break other behaviors" ,
4846)
49- # fmt: off
50- @pytest .mark .parametrize ("prefix" , ("" , "abcd" , u"лошадь" ))
51- @pytest .mark .parametrize ("character" , u"\x00 \x07 \x1b \n " )
52- # fmt: on
47+ @pytest .mark .parametrize ("prefix" , ("" , "abcd" , "лошадь" ))
48+ @pytest .mark .parametrize ("character" , "\x00 \x07 \x1b \n " )
5349def test_safe_repr_non_printable (prefix , character ):
5450 """Check that non-printable characters are escaped"""
5551 string = prefix + character
@@ -517,27 +513,25 @@ def test_iter_stacktraces():
517513 ) == {1 , 2 , 3 }
518514
519515
520- # fmt: off
521516@pytest .mark .parametrize (
522517 ("original" , "base64_encoded" ),
523518 [
524519 # ascii only
525520 ("Dogs are great!" , "RG9ncyBhcmUgZ3JlYXQh" ),
526521 # emoji
527- (u "🐶" , "8J+Qtg==" ),
522+ ("🐶" , "8J+Qtg==" ),
528523 # non-ascii
529524 (
530- u "Καλό κορίτσι, Μάιζεϊ!" ,
525+ "Καλό κορίτσι, Μάιζεϊ!" ,
531526 "zprOsc67z4wgzrrOv8+Bzq/PhM+DzrksIM6czqzOuc62zrXPiiE=" ,
532527 ),
533528 # mix of ascii and non-ascii
534529 (
535- u "Of margir hundar! Ég geri ráð fyrir að ég þurfi stærra rúm." ,
530+ "Of margir hundar! Ég geri ráð fyrir að ég þurfi stærra rúm." ,
536531 "T2YgbWFyZ2lyIGh1bmRhciEgw4lnIGdlcmkgcsOhw7AgZnlyaXIgYcOwIMOpZyDDvnVyZmkgc3TDpnJyYSByw7ptLg==" ,
537532 ),
538533 ],
539534)
540- # fmt: on
541535def test_successful_base64_conversion (original , base64_encoded ):
542536 # all unicode characters should be handled correctly
543537 assert to_base64 (original ) == base64_encoded
@@ -587,7 +581,5 @@ def test_strip_string():
587581 assert stripped_text .value .count ("a" ) == 1021 # + '...' is 1024
588582
589583 # If text has unicode characters, it counts bytes and not number of characters.
590- # fmt: off
591- text_with_unicode_character = u"éê"
592- assert strip_string (text_with_unicode_character , max_length = 2 ).value == u"é..."
593- # fmt: on
584+ text_with_unicode_character = "éê"
585+ assert strip_string (text_with_unicode_character , max_length = 2 ).value == "é..."
0 commit comments