@@ -16,7 +16,7 @@ class LazyImportTest(unittest.TestCase):
1616 def test_lazy_import (self ):
1717 ensure_lazy_imports ("base64" , {"re" , "getopt" })
1818
19- from test .support .hypothesis_helper import hypothesis
19+ from test .support .hypothesis_helper import hypothesis , mark_hypothesis
2020
2121
2222class LegacyBase64TestCase (unittest .TestCase ):
@@ -74,6 +74,7 @@ def test_decodebytes(self):
7474
7575 @hypothesis .given (payload = hypothesis .strategies .binary ())
7676 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' )
77+ @mark_hypothesis
7778 def test_bytes_encode_decode_round_trip (self , payload ):
7879 encoded = base64 .encodebytes (payload )
7980 decoded = base64 .decodebytes (encoded )
@@ -109,6 +110,7 @@ def test_decode(self):
109110
110111 @hypothesis .given (payload = hypothesis .strategies .binary ())
111112 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' )
113+ @mark_hypothesis
112114 def test_legacy_encode_decode_round_trip (self , payload ):
113115 from io import BytesIO
114116 payload_file_r = BytesIO (payload )
@@ -503,6 +505,7 @@ def _altchars_strategy():
503505 validate = hypothesis .strategies .booleans ())
504506 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' , b"_-" , True )
505507 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' , b"_-" , False )
508+ @mark_hypothesis
506509 def test_b64_encode_decode_round_trip (self , payload , altchars , validate ):
507510 encoded = base64 .b64encode (payload , altchars = altchars )
508511 decoded = base64 .b64decode (encoded , altchars = altchars ,
@@ -511,13 +514,15 @@ def test_b64_encode_decode_round_trip(self, payload, altchars, validate):
511514
512515 @hypothesis .given (payload = hypothesis .strategies .binary ())
513516 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' )
517+ @mark_hypothesis
514518 def test_standard_b64_encode_decode_round_trip (self , payload ):
515519 encoded = base64 .standard_b64encode (payload )
516520 decoded = base64 .standard_b64decode (encoded )
517521 self .assertEqual (payload , decoded )
518522
519523 @hypothesis .given (payload = hypothesis .strategies .binary ())
520524 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' )
525+ @mark_hypothesis
521526 def test_urlsafe_b64_encode_decode_round_trip (self , payload ):
522527 encoded = base64 .urlsafe_b64encode (payload )
523528 decoded = base64 .urlsafe_b64decode (encoded )
@@ -701,6 +706,7 @@ def test_b32decode_error(self):
701706 | hypothesis .strategies .binary (min_size = 1 , max_size = 1 )))
702707 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' , True , None )
703708 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' , False , None )
709+ @mark_hypothesis
704710 def test_b32_encode_decode_round_trip (self , payload , casefold , map01 ):
705711 encoded = base64 .b32encode (payload )
706712 decoded = base64 .b32decode (encoded , casefold = casefold , map01 = map01 )
@@ -837,6 +843,7 @@ def test_b32hexdecode_error(self):
837843 casefold = hypothesis .strategies .booleans ())
838844 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' , True )
839845 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' , False )
846+ @mark_hypothesis
840847 def test_b32_hexencode_decode_round_trip (self , payload , casefold ):
841848 encoded = base64 .b32hexencode (payload )
842849 decoded = base64 .b32hexdecode (encoded , casefold = casefold )
@@ -899,6 +906,7 @@ def test_b16decode_ignorechars(self):
899906 casefold = hypothesis .strategies .booleans ())
900907 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' , True )
901908 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' , False )
909+ @mark_hypothesis
902910 def test_b16_encode_decode_round_trip (self , payload , casefold ):
903911 endoded = base64 .b16encode (payload )
904912 decoded = base64 .b16decode (endoded , casefold = casefold )
@@ -1321,6 +1329,7 @@ def add_padding(self, payload):
13211329 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' , False , 20 , True , True )
13221330 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' , True , 0 , False , True )
13231331 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' , True , 20 , True , False )
1332+ @mark_hypothesis
13241333 def test_a85_encode_decode_round_trip (
13251334 self , payload , foldspaces , wrapcol , pad , adobe
13261335 ):
@@ -1349,6 +1358,7 @@ def test_a85_encode_decode_round_trip(
13491358 pad = hypothesis .strategies .booleans ())
13501359 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' , True )
13511360 @hypothesis .example (b'abcdefghijklmnopqrstuvwxyz' , False )
1361+ @mark_hypothesis
13521362 def test_b85_encode_decode_round_trip (self , payload , pad ):
13531363 encoded = base64 .b85encode (payload , pad = pad )
13541364 if pad :
0 commit comments