@@ -163,15 +163,15 @@ def valid_cases():
163163 for mode in modes :
164164 for variation in range (3 ):
165165 yield f'{ name } _{ mode .to_name ()} _chaos_{ variation } ' , \
166- valid_test_case (lambda : container_case_fn (rng , mode , typ , chaos = True ))
166+ valid_test_case (lambda : container_case_fn (rng , mode , typ , chaos = True ))
167167 # Notes: Below is the second wave of iteration, and only the random mode is selected
168168 # for container without offset since ``RandomizationMode.mode_zero`` and ``RandomizationMode.mode_max``
169169 # are deterministic.
170170 modes = [RandomizationMode .mode_random ] if len (offsets ) == 0 else list (RandomizationMode )
171171 for mode in modes :
172172 for variation in range (10 ):
173173 yield f'{ name } _{ mode .to_name ()} _{ variation } ' , \
174- valid_test_case (lambda : container_case_fn (rng , mode , typ ))
174+ valid_test_case (lambda : container_case_fn (rng , mode , typ ))
175175
176176
177177def mod_offset (b : bytes , offset_index : int , change : Callable [[int ], int ]):
@@ -186,8 +186,8 @@ def invalid_cases():
186186 for (name , (typ , offsets )) in PRESET_CONTAINERS .items ():
187187 # using mode_max_count, so that the extra byte cannot be picked up as normal list content
188188 yield f'{ name } _extra_byte' , \
189- invalid_test_case (lambda : serialize (
190- container_case_fn (rng , RandomizationMode .mode_max_count , typ )) + b'\xff ' )
189+ invalid_test_case (lambda : serialize (
190+ container_case_fn (rng , RandomizationMode .mode_max_count , typ )) + b'\xff ' )
191191
192192 if len (offsets ) != 0 :
193193 # Note: there are many more ways to have invalid offsets,
@@ -198,23 +198,23 @@ def invalid_cases():
198198 RandomizationMode .mode_max_count ]:
199199 for index , offset_index in enumerate (offsets ):
200200 yield f'{ name } _{ mode .to_name ()} _offset_{ offset_index } _plus_one' , \
201- invalid_test_case (lambda : mod_offset (
202- b = serialize (container_case_fn (rng , mode , typ )),
203- offset_index = offset_index ,
204- change = lambda x : x + 1
205- ))
201+ invalid_test_case (lambda : mod_offset (
202+ b = serialize (container_case_fn (rng , mode , typ )),
203+ offset_index = offset_index ,
204+ change = lambda x : x + 1
205+ ))
206206 yield f'{ name } _{ mode .to_name ()} _offset_{ offset_index } _zeroed' , \
207- invalid_test_case (lambda : mod_offset (
208- b = serialize (container_case_fn (rng , mode , typ )),
209- offset_index = offset_index ,
210- change = lambda x : 0
211- ))
207+ invalid_test_case (lambda : mod_offset (
208+ b = serialize (container_case_fn (rng , mode , typ )),
209+ offset_index = offset_index ,
210+ change = lambda x : 0
211+ ))
212212 if index == 0 :
213213 yield f'{ name } _{ mode .to_name ()} _offset_{ offset_index } _minus_one' , \
214214 invalid_test_case (lambda : mod_offset (
215- b = serialize (container_case_fn (rng , mode , typ )),
216- offset_index = offset_index ,
217- change = lambda x : x - 1
215+ b = serialize (container_case_fn (rng , mode , typ )),
216+ offset_index = offset_index ,
217+ change = lambda x : x - 1
218218 ))
219219 if mode == RandomizationMode .mode_max_count :
220220 serialized = serialize (container_case_fn (rng , mode , typ ))
0 commit comments