Skip to content

Commit 3394ef3

Browse files
committed
Fixed test format that fails CI
1 parent 7cc6229 commit 3394ef3

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

tests/test_py_init.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@
115115
(None, None),
116116
],
117117
)
118-
119118
@pytest.mark.skip(reason="WIP: started seeing odd failures")
120119
def test_py_init_with_errors(
121120
bits,
@@ -127,10 +126,12 @@ def test_py_init_with_errors(
127126
num_val,
128127
num_error,
129128
th_val,
130-
th_error
129+
th_error,
131130
):
132131

133-
expected_error = check_error(bits_error, rand_error, sec_error, num_error, th_error)
132+
expected_error = check_error(
133+
bits_error, rand_error, sec_error, num_error, th_error
134+
)
134135

135136
if expected_error:
136137
with pytest.raises(ValueError, match=expected_error):
@@ -146,11 +147,11 @@ def test_py_init_with_errors(
146147
num_shares = base_value(num_val)
147148
shares = secrets.share(secret, num_shares, 3)
148149
if not bits_error or rand_error:
149-
150+
150151
numShares = low_random(settings.maxShares, settings.bits)
151152
threshold = base_value(th_val)
152153
shares = secrets.share(secret, numShares, threshold)
153-
154+
154155
assert len(caught_warnings) == 1
155156
assert issubclass(caught_warnings[0].category, Warning)
156157
assert expected_error in str(caught_warnings[0].message)
@@ -174,7 +175,13 @@ def check_error(bits_error, rand_error, sec_error, num_error, th_error):
174175
rand_error
175176
if rand_error
176177
else (
177-
sec_error if sec_error else (num_error if num_error else (th_error if th_error else None))
178+
sec_error
179+
if sec_error
180+
else (
181+
num_error
182+
if num_error
183+
else (th_error if th_error else None)
184+
)
178185
)
179186
)
180187
)

0 commit comments

Comments
 (0)