Skip to content

Commit 29167c5

Browse files
committed
fmt
1 parent c6e827d commit 29167c5

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

tests/clients/test_flexible_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from tests.test_utils.assert_metrics_dict import assert_metrics_dict
2525
from tests.test_utils.models_for_test import LinearModel
2626

27+
2728
freezegun.configure(extend_ignore_list=["transformers"]) # type: ignore
2829

2930

@@ -249,8 +250,7 @@ def mock_validate_or_test( # type: ignore
249250
fold_loss_dict_into_metrics(self.mock_metrics, self.mock_loss_dict, logging_mode)
250251
if logging_mode == LoggingMode.VALIDATION:
251252
return self.mock_loss, self.mock_metrics
252-
else:
253-
return self.mock_loss, self.mock_metrics_test
253+
return self.mock_loss, self.mock_metrics_test
254254

255255

256256
def test_subclass_raises_warning_if_override_val_step() -> None:
@@ -261,7 +261,7 @@ def test_subclass_raises_warning_if_override_val_step() -> None:
261261
with pytest.warns(RuntimeWarning, match=re.escape(msg)):
262262

263263
class _TestSubclass(FlexibleClient):
264-
"""A subclass that overrides val_step"""
264+
"""A subclass that overrides val_step."""
265265

266266
def val_step(
267267
self, input: TorchInputType, target: TorchTargetType
@@ -278,7 +278,7 @@ def test_subclass_raises_warning_if_override_train_step() -> None:
278278
with pytest.warns(RuntimeWarning, match=re.escape(msg)):
279279

280280
class _TestSubclass(FlexibleClient):
281-
"""A subclass that overrides train_step"""
281+
"""A subclass that overrides train_step."""
282282

283283
def train_step(
284284
self, input: TorchInputType, target: TorchTargetType

tests/mixins/personalized/test_ditto.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class _TestDittoedClient(DittoPersonalizedMixin, _TestFlexibleClient):
4949

5050

5151
class _DummyParent:
52-
5352
def __init__(self) -> None:
5453
pass
5554

@@ -81,15 +80,14 @@ class _InvalidTestDittoClient(DittoPersonalizedMixin):
8180
pass
8281

8382
with pytest.raises(RuntimeError, match="This object needs to satisfy `FlexibleClientProtocolPreSetup`."):
84-
8583
_InvalidTestDittoClient(data_path=Path(""), metrics=[Accuracy()])
8684

8785

8886
def test_subclass_checks_raise_no_warning() -> None:
8987
with warnings.catch_warnings(record=True) as recorded_warnings:
9088

9189
class _TestInheritanceMixin(DittoPersonalizedMixin, _TestFlexibleClient):
92-
"""subclass should skip validation if is itself a Mixin that inherits DittoPersonalizedMixin"""
90+
"""Subclass should skip validation if is itself a Mixin that inherits DittoPersonalizedMixin."""
9391

9492
pass
9593

@@ -370,7 +368,6 @@ def test_val_step(
370368

371369
def test_raise_runtime_error_not_flexible_client() -> None:
372370
"""Test that an invalid parent raises RuntimeError."""
373-
374371
with pytest.raises(
375372
RuntimeError, match=re.escape("This object needs to satisfy `FlexibleClientProtocolPreSetup`.")
376373
):

tests/mixins/test_adaptive_drift_constrained.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,14 @@ class _InvalidTestAdaptedClient(AdaptiveDriftConstrainedMixin):
6767
pass
6868

6969
with pytest.raises(RuntimeError, match="This object needs to satisfy `FlexibleClientProtocolPreSetup`."):
70-
7170
_InvalidTestAdaptedClient(data_path=Path(""), metrics=[Accuracy()])
7271

7372

7473
def test_subclass_checks_raise_no_warning() -> None:
7574
with warnings.catch_warnings(record=True) as recorded_warnings:
7675

7776
class _TestInheritanceMixin(AdaptiveDriftConstrainedMixin, _TestFlexibleClient):
78-
"""subclass should skip validation if is itself a Mixin that inherits AdaptiveDriftConstrainedMixin"""
77+
"""Subclass should skip validation if is itself a Mixin that inherits AdaptiveDriftConstrainedMixin."""
7978

8079
pass
8180

0 commit comments

Comments
 (0)