Skip to content

Commit 4318f7b

Browse files
committed
Fix lint
1 parent add6f16 commit 4318f7b

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

tests/generators/ssz_generic/ssz_profile.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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

177177
def 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))

tests/generators/ssz_generic/ssz_stablecontainer.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ def valid_cases():
7777
for mode in modes:
7878
for variation in range(3):
7979
yield f'{name}_{mode.to_name()}_chaos_{variation}', \
80-
valid_test_case(lambda: container_case_fn(rng, mode, typ, chaos=True))
80+
valid_test_case(lambda: container_case_fn(rng, mode, typ, chaos=True))
8181
# Notes: Below is the second wave of iteration, and only the random mode is selected
8282
# for container without offset since ``RandomizationMode.mode_zero`` and ``RandomizationMode.mode_max``
8383
# are deterministic.
8484
modes = [RandomizationMode.mode_random] if len(offsets) == 0 else list(RandomizationMode)
8585
for mode in modes:
8686
for variation in range(10):
8787
yield f'{name}_{mode.to_name()}_{variation}', \
88-
valid_test_case(lambda: container_case_fn(rng, mode, typ))
88+
valid_test_case(lambda: container_case_fn(rng, mode, typ))
8989

9090

9191
def mod_offset(b: bytes, offset_index: int, change: Callable[[int], int]):
@@ -100,8 +100,8 @@ def invalid_cases():
100100
for (name, (typ, offsets)) in PRESET_CONTAINERS.items():
101101
# using mode_max_count, so that the extra byte cannot be picked up as normal list content
102102
yield f'{name}_extra_byte', \
103-
invalid_test_case(lambda: serialize(
104-
container_case_fn(rng, RandomizationMode.mode_max_count, typ)) + b'\xff')
103+
invalid_test_case(lambda: serialize(
104+
container_case_fn(rng, RandomizationMode.mode_max_count, typ)) + b'\xff')
105105

106106
if len(offsets) != 0:
107107
# Note: there are many more ways to have invalid offsets,
@@ -112,23 +112,23 @@ def invalid_cases():
112112
RandomizationMode.mode_max_count]:
113113
for index, offset_index in enumerate(offsets):
114114
yield f'{name}_{mode.to_name()}_offset_{offset_index}_plus_one', \
115-
invalid_test_case(lambda: mod_offset(
116-
b=serialize(container_case_fn(rng, mode, typ)),
117-
offset_index=offset_index,
118-
change=lambda x: x + 1
119-
))
115+
invalid_test_case(lambda: mod_offset(
116+
b=serialize(container_case_fn(rng, mode, typ)),
117+
offset_index=offset_index,
118+
change=lambda x: x + 1
119+
))
120120
yield f'{name}_{mode.to_name()}_offset_{offset_index}_zeroed', \
121-
invalid_test_case(lambda: mod_offset(
122-
b=serialize(container_case_fn(rng, mode, typ)),
123-
offset_index=offset_index,
124-
change=lambda x: 0
125-
))
121+
invalid_test_case(lambda: mod_offset(
122+
b=serialize(container_case_fn(rng, mode, typ)),
123+
offset_index=offset_index,
124+
change=lambda x: 0
125+
))
126126
if index == 0:
127127
yield f'{name}_{mode.to_name()}_offset_{offset_index}_minus_one', \
128128
invalid_test_case(lambda: mod_offset(
129-
b=serialize(container_case_fn(rng, mode, typ)),
130-
offset_index=offset_index,
131-
change=lambda x: x - 1
129+
b=serialize(container_case_fn(rng, mode, typ)),
130+
offset_index=offset_index,
131+
change=lambda x: x - 1
132132
))
133133
if mode == RandomizationMode.mode_max_count:
134134
serialized = serialize(container_case_fn(rng, mode, typ))

0 commit comments

Comments
 (0)