Skip to content

Commit ebb7590

Browse files
committed
style: apply ruff formatting to test files
1 parent dde5e6b commit ebb7590

3 files changed

Lines changed: 27 additions & 32 deletions

File tree

tests/test_rich_observers.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -674,9 +674,7 @@ class TestRichDashboardObserverProperties:
674674
),
675675
)
676676
@settings(max_examples=50)
677-
def test_error_counts_match_occurrences(
678-
self, error_events: list[tuple[str, str]]
679-
) -> None:
677+
def test_error_counts_match_occurrences(self, error_events: list[tuple[str, str]]) -> None:
680678
"""Test that error counts accurately reflect the number of occurrences."""
681679
observer = RichDashboardObserver()
682680

@@ -700,19 +698,19 @@ def test_error_counts_match_occurrences(
700698

701699
@given(
702700
stats_list=st.lists(
703-
st.fixed_dictionaries({
704-
"total": st.integers(min_value=0, max_value=10000),
705-
"valid": st.integers(min_value=0, max_value=10000),
706-
"failed": st.integers(min_value=0, max_value=10000),
707-
}),
701+
st.fixed_dictionaries(
702+
{
703+
"total": st.integers(min_value=0, max_value=10000),
704+
"valid": st.integers(min_value=0, max_value=10000),
705+
"failed": st.integers(min_value=0, max_value=10000),
706+
}
707+
),
708708
min_size=1,
709709
max_size=20,
710710
),
711711
)
712712
@settings(max_examples=30)
713-
def test_stats_snapshot_matches_last_event(
714-
self, stats_list: list[dict[str, int]]
715-
) -> None:
713+
def test_stats_snapshot_matches_last_event(self, stats_list: list[dict[str, int]]) -> None:
716714
"""Test that stats_snapshot always matches the last ROW_PROCESSED event."""
717715
observer = RichDashboardObserver()
718716

tests/test_runner.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -981,22 +981,19 @@ def test_parallel_emits_events(self) -> None:
981981

982982
# Should have VALIDATION_STARTED
983983
started_events = [
984-
e for e in observer.events
985-
if e.event_type == ValidationEventType.VALIDATION_STARTED
984+
e for e in observer.events if e.event_type == ValidationEventType.VALIDATION_STARTED
986985
]
987986
assert len(started_events) == 1
988987

989988
# Should have VALIDATION_COMPLETED
990989
completed_events = [
991-
e for e in observer.events
992-
if e.event_type == ValidationEventType.VALIDATION_COMPLETED
990+
e for e in observer.events if e.event_type == ValidationEventType.VALIDATION_COMPLETED
993991
]
994992
assert len(completed_events) == 1
995993

996994
# Should have ROW_PROCESSED for each row
997995
row_events = [
998-
e for e in observer.events
999-
if e.event_type == ValidationEventType.ROW_PROCESSED
996+
e for e in observer.events if e.event_type == ValidationEventType.ROW_PROCESSED
1000997
]
1001998
assert len(row_events) == 10
1002999

@@ -1010,8 +1007,7 @@ def test_parallel_started_event_includes_workers(self) -> None:
10101007
list(runner.run(workers=4, chunk_size=5))
10111008

10121009
started_events = [
1013-
e for e in observer.events
1014-
if e.event_type == ValidationEventType.VALIDATION_STARTED
1010+
e for e in observer.events if e.event_type == ValidationEventType.VALIDATION_STARTED
10151011
]
10161012
assert len(started_events) == 1
10171013
assert started_events[0].data.get("workers") == 4
@@ -1062,8 +1058,7 @@ def test_parallel_uses_sequential_for_single_worker(self) -> None:
10621058

10631059
# In sequential mode, no worker info in started event
10641060
started_events = [
1065-
e for e in observer.events
1066-
if e.event_type == ValidationEventType.VALIDATION_STARTED
1061+
e for e in observer.events if e.event_type == ValidationEventType.VALIDATION_STARTED
10671062
]
10681063
assert "workers" not in started_events[0].data
10691064

@@ -1236,14 +1231,18 @@ def test_top_errors_counts_match(self, errors: list[tuple[str, str]]) -> None:
12361231
assert total_from_top == len(errors)
12371232

12381233
@given(
1239-
stats1_data=st.fixed_dictionaries({
1240-
"total": st.integers(min_value=0, max_value=1000),
1241-
"valid": st.integers(min_value=0, max_value=1000),
1242-
}),
1243-
stats2_data=st.fixed_dictionaries({
1244-
"total": st.integers(min_value=0, max_value=1000),
1245-
"valid": st.integers(min_value=0, max_value=1000),
1246-
}),
1234+
stats1_data=st.fixed_dictionaries(
1235+
{
1236+
"total": st.integers(min_value=0, max_value=1000),
1237+
"valid": st.integers(min_value=0, max_value=1000),
1238+
}
1239+
),
1240+
stats2_data=st.fixed_dictionaries(
1241+
{
1242+
"total": st.integers(min_value=0, max_value=1000),
1243+
"valid": st.integers(min_value=0, max_value=1000),
1244+
}
1245+
),
12471246
)
12481247
@settings(max_examples=50)
12491248
def test_merge_is_additive(

tests/test_validators.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,7 @@ def test_composite_validator_count(self, count: int) -> None:
415415
@settings(max_examples=50)
416416
def test_validator_names_match(self, names: list[str]) -> None:
417417
"""validator_names matches actual validator.name values."""
418-
validators: list[BaseValidator[SampleModel]] = [
419-
SimpleValidator(name) for name in names
420-
]
418+
validators: list[BaseValidator[SampleModel]] = [SimpleValidator(name) for name in names]
421419
composite = CompositeValidator[SampleModel](validators=validators)
422420

423421
assert composite.validator_names == names

0 commit comments

Comments
 (0)