Skip to content

Commit 2d3f833

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent c272633 commit 2d3f833

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/tests_pytorch/checkpointing/test_model_checkpoint.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,7 @@ def on_validation_start(self) -> None:
800800
def test_model_checkpoint_on_exception_fast_dev_run_on_train_batch_start(tmp_path):
801801
"""Test that no checkpoint is saved when an exception is raised during a sanity check or a fast dev run, or when a
802802
checkpoint has already been saved at the current training step."""
803+
803804
# Don't save checkpoint if fast dev run fails
804805
class TroubledModelFastDevRun(BoringModel):
805806
def on_train_batch_start(self, batch, batch_idx) -> None:
@@ -821,9 +822,11 @@ def on_train_batch_start(self, batch, batch_idx) -> None:
821822
trainer.fit(model)
822823
assert not os.path.isfile(tmp_path / "exception-fast_dev_run.ckpt")
823824

825+
824826
def test_model_checkpoint_on_exception_run_condition_on_train_batch_start(tmp_path):
825827
"""Test that no checkpoint is saved when an exception is raised during a sanity check or a fast dev run, or when a
826828
checkpoint has already been saved at the current training step."""
829+
827830
# Don't save checkpoint if already saved a checkpoint
828831
class TroubledModelAlreadySavedCheckpoint(BoringModel):
829832
def on_train_batch_start(self, batch, batch_idx) -> None:

0 commit comments

Comments
 (0)