Skip to content

Commit 2c7f75d

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

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/tests_pytorch/checkpointing/test_model_checkpoint.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,27 +1669,27 @@ def val_dataloader(self) -> DataLoader:
16691669

16701670

16711671
def test_save_last_without_save_on_train_epoch_and_without_val(tmp_path):
1672-
"""Test that save_last=True when save_on_train_epoch_end=False"""
1672+
"""Test that save_last=True when save_on_train_epoch_end=False."""
16731673

16741674
# Remove validation methods to reproduce the bug
16751675
model = BoringModel()
16761676
model.validation_step = None
16771677
model.val_dataloader = None
1678-
1678+
16791679
checkpoint_callback = ModelCheckpoint(
16801680
dirpath=tmp_path,
16811681
save_last=True,
16821682
save_on_train_epoch_end=False,
16831683
)
1684-
1684+
16851685
trainer = Trainer(
16861686
max_epochs=2,
16871687
callbacks=[checkpoint_callback],
16881688
logger=False,
16891689
enable_progress_bar=False,
16901690
)
1691-
1691+
16921692
trainer.fit(model)
1693-
1693+
16941694
# save_last=True should always save last.ckpt
16951695
assert (tmp_path / "last.ckpt").exists()

0 commit comments

Comments
 (0)