Skip to content

Commit ff9708d

Browse files
committed
Test fixes
1 parent 675ea88 commit ff9708d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/tests_pytorch/core/test_datamodules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def load_state_dict(self, state_dict: Dict[str, Any]) -> None:
230230

231231
for trainer_fn in TrainerFn:
232232
trainer.state.fn = trainer_fn
233-
trainer._restore_modules_and_callbacks(checkpoint_path)
233+
trainer._checkpoint_connector._restore_modules_and_callbacks(checkpoint_path)
234234
assert dm.my_state_dict == {"my": "state_dict"}
235235

236236

tests/tests_pytorch/trainer/connectors/test_checkpoint_connector.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def test_preloaded_checkpoint_lifecycle(tmpdir):
5252
assert isinstance(connector._loaded_checkpoint, dict)
5353
trainer.state.fn = TrainerFn.FITTING
5454
connector.resume_end()
55-
assert not connector._ckpt_path
55+
# not cleared until next restoration, as the user might access it through `trainer.ckpt_path`
56+
assert connector._ckpt_path == ckpt_path
5657
assert not connector._loaded_checkpoint
5758

5859

0 commit comments

Comments
 (0)