Skip to content

Commit

Permalink
black: format code with black 24
Browse files Browse the repository at this point in the history
Adding skip fmt to avoid issues with black < 24.

New rule added in black 24 is:
> If an assignment statement is too long, we now prefer splitting on the right-hand side
> psf/black#3368
  • Loading branch information
rgonzalezfluendo committed Feb 12, 2024
1 parent d9106f5 commit a84df86
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions fluster/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ def __init__(

def _test(self) -> None:
if self.skip:
self.test_suite.test_vectors[
self.test_vector.name
].test_result = TestVectorResult.NOT_RUN
# fmt: skip
self.test_suite.test_vectors[self.test_vector.name].test_result = (
TestVectorResult.NOT_RUN
)

return

Expand Down Expand Up @@ -89,17 +90,19 @@ def _test(self) -> None:
perf_counter() - start
)
except TimeoutExpired:
self.test_suite.test_vectors[
self.test_vector.name
].test_result = TestVectorResult.TIMEOUT
# fmt: skip
self.test_suite.test_vectors[self.test_vector.name].test_result = (
TestVectorResult.TIMEOUT
)
self.test_suite.test_vectors[self.test_vector.name].test_time = (
perf_counter() - start
)
raise
except Exception:
self.test_suite.test_vectors[
self.test_vector.name
].test_result = TestVectorResult.ERROR
# fmt: skip
self.test_suite.test_vectors[self.test_vector.name].test_result = (
TestVectorResult.ERROR
)
self.test_suite.test_vectors[self.test_vector.name].test_time = (
perf_counter() - start
)
Expand All @@ -113,20 +116,23 @@ def _test(self) -> None:
os.remove(output_filepath)

if not self.reference:
self.test_suite.test_vectors[
self.test_vector.name
].test_result = TestVectorResult.FAIL
# fmt: skip
self.test_suite.test_vectors[self.test_vector.name].test_result = (
TestVectorResult.FAIL
)
if self.test_vector.result.lower() == result.lower():
self.test_suite.test_vectors[
self.test_vector.name
].test_result = TestVectorResult.SUCCESS
# fmt: skip
self.test_suite.test_vectors[self.test_vector.name].test_result = (
TestVectorResult.SUCCESS
)
self.assertEqual(
self.test_vector.result.lower(),
result.lower(),
self.test_vector.name,
)
else:
self.test_suite.test_vectors[
self.test_vector.name
].test_result = TestVectorResult.REFERENCE
# fmt: skip
self.test_suite.test_vectors[self.test_vector.name].test_result = (
TestVectorResult.REFERENCE
)
self.test_suite.test_vectors[self.test_vector.name].result = result

0 comments on commit a84df86

Please sign in to comment.