Skip to content

Commit 3accd56

Browse files
committed
Ruff formatting
1 parent 0cbccef commit 3accd56

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

edtf/natlang/tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ def test_natlang(input_text, expected_output):
182182
Verify that the conversion from text to EDTF format matches the expected output.
183183
"""
184184
result = text_to_edtf(input_text)
185-
assert (
186-
result == expected_output
187-
), f"Failed for input: {input_text} - expected {expected_output}, got {result}"
185+
assert result == expected_output, (
186+
f"Failed for input: {input_text} - expected {expected_output}, got {result}"
187+
)
188188

189189

190190
@pytest.mark.benchmark

edtf/parser/tests.py

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -312,51 +312,51 @@ def test_edtf_examples(test_input, expected_tuple):
312312

313313
# Unpack expected results based on their count
314314
if len(expected_tuple) == 1:
315-
assert (
316-
result_date == expected_tuple[0]
317-
), f"Expected {expected_tuple[0]}, got {result_date}"
315+
assert result_date == expected_tuple[0], (
316+
f"Expected {expected_tuple[0]}, got {result_date}"
317+
)
318318
elif len(expected_tuple) == 2:
319319
lower_strict = iso_to_struct_time(expected_tuple[0])
320320
upper_strict = iso_to_struct_time(expected_tuple[1])
321-
assert (
322-
result.lower_strict() == lower_strict
323-
), f"Lower strict date does not match. Expected {lower_strict}, got {result.lower_strict()}"
324-
assert (
325-
result.upper_strict() == upper_strict
326-
), f"Upper strict date does not match. Expected {upper_strict}, got {result.upper_strict()}"
321+
assert result.lower_strict() == lower_strict, (
322+
f"Lower strict date does not match. Expected {lower_strict}, got {result.lower_strict()}"
323+
)
324+
assert result.upper_strict() == upper_strict, (
325+
f"Upper strict date does not match. Expected {upper_strict}, got {result.upper_strict()}"
326+
)
327327
elif len(expected_tuple) == 3:
328328
strict_date = iso_to_struct_time(expected_tuple[0])
329329
lower_fuzzy = iso_to_struct_time(expected_tuple[1])
330330
upper_fuzzy = iso_to_struct_time(expected_tuple[2])
331-
assert (
332-
result.lower_strict() == strict_date
333-
), f"Lower strict date does not match. Expected {strict_date}, got {result.lower_strict()}"
334-
assert (
335-
result.upper_strict() == strict_date
336-
), f"Upper strict date does not match. Expected {strict_date}, got {result.upper_strict()}"
337-
assert (
338-
result.lower_fuzzy() == lower_fuzzy
339-
), f"Lower fuzzy date does not match. Expected {lower_fuzzy}, got {result.lower_fuzzy()}"
340-
assert (
341-
result.upper_fuzzy() == upper_fuzzy
342-
), f"Upper fuzzy date does not match. Expected {upper_fuzzy}, got {result.upper_fuzzy()}"
331+
assert result.lower_strict() == strict_date, (
332+
f"Lower strict date does not match. Expected {strict_date}, got {result.lower_strict()}"
333+
)
334+
assert result.upper_strict() == strict_date, (
335+
f"Upper strict date does not match. Expected {strict_date}, got {result.upper_strict()}"
336+
)
337+
assert result.lower_fuzzy() == lower_fuzzy, (
338+
f"Lower fuzzy date does not match. Expected {lower_fuzzy}, got {result.lower_fuzzy()}"
339+
)
340+
assert result.upper_fuzzy() == upper_fuzzy, (
341+
f"Upper fuzzy date does not match. Expected {upper_fuzzy}, got {result.upper_fuzzy()}"
342+
)
343343
elif len(expected_tuple) == 4:
344344
lower_strict = iso_to_struct_time(expected_tuple[0])
345345
upper_strict = iso_to_struct_time(expected_tuple[1])
346346
lower_fuzzy = iso_to_struct_time(expected_tuple[2])
347347
upper_fuzzy = iso_to_struct_time(expected_tuple[3])
348-
assert (
349-
result.lower_strict() == lower_strict
350-
), f"Lower strict date does not match. Expected {lower_strict}, got {result.lower_strict()}"
351-
assert (
352-
result.upper_strict() == upper_strict
353-
), f"Upper strict date does not match. Expected {upper_strict}, got {result.upper_strict()}"
354-
assert (
355-
result.lower_fuzzy() == lower_fuzzy
356-
), f"Lower fuzzy date does not match. Expected {lower_fuzzy}, got {result.lower_fuzzy()}"
357-
assert (
358-
result.upper_fuzzy() == upper_fuzzy
359-
), f"Upper fuzzy date does not match. Expected {upper_fuzzy}, got {result.upper_fuzzy()}"
348+
assert result.lower_strict() == lower_strict, (
349+
f"Lower strict date does not match. Expected {lower_strict}, got {result.lower_strict()}"
350+
)
351+
assert result.upper_strict() == upper_strict, (
352+
f"Upper strict date does not match. Expected {upper_strict}, got {result.upper_strict()}"
353+
)
354+
assert result.lower_fuzzy() == lower_fuzzy, (
355+
f"Lower fuzzy date does not match. Expected {lower_fuzzy}, got {result.lower_fuzzy()}"
356+
)
357+
assert result.upper_fuzzy() == upper_fuzzy, (
358+
f"Upper fuzzy date does not match. Expected {upper_fuzzy}, got {result.upper_fuzzy()}"
359+
)
360360

361361

362362
@pytest.mark.parametrize("bad_input", BAD_EXAMPLES)

0 commit comments

Comments
 (0)