Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions tests/deprecated_api/test_remove_1-4.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,10 @@

import pytest

from pytorch_lightning import Trainer
from tests.deprecated_api import _soft_unimport_module
from tests.helpers import BoringModel


def test_v1_4_0_deprecated_imports():
_soft_unimport_module('pytorch_lightning.utilities.argparse_utils')
with pytest.deprecated_call(match='will be removed in v1.4'):
from pytorch_lightning.utilities.argparse_utils import _gpus_arg_default # noqa: F811 F401


def test_v1_4_0_deprecated_hpc_load(tmpdir):
model = BoringModel()
trainer = Trainer(
default_root_dir=tmpdir,
max_steps=1,
)
trainer.fit(model)
trainer.checkpoint_connector.hpc_save(tmpdir, trainer.logger)
checkpoint_path = trainer.checkpoint_connector.get_max_ckpt_path_from_folder(str(tmpdir))
with pytest.deprecated_call(match=r"`CheckpointConnector.hpc_load\(\)` was deprecated in v1.4"):
trainer.checkpoint_connector.hpc_load(checkpoint_path)
13 changes: 13 additions & 0 deletions tests/deprecated_api/test_remove_1-6.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,16 @@ def test_v1_6_0_deprecated_disable_validation():
def test_v1_6_0_every_n_val_epochs():
with pytest.deprecated_call(match="use `every_n_epochs` instead"):
_ = ModelCheckpoint(every_n_val_epochs=1)


def test_v1_6_0_deprecated_hpc_load(tmpdir):
model = BoringModel()
trainer = Trainer(
default_root_dir=tmpdir,
max_steps=1,
)
trainer.fit(model)
trainer.checkpoint_connector.hpc_save(tmpdir, trainer.logger)
checkpoint_path = trainer.checkpoint_connector.get_max_ckpt_path_from_folder(str(tmpdir))
with pytest.deprecated_call(match=r"`CheckpointConnector.hpc_load\(\)` was deprecated in v1.4"):
trainer.checkpoint_connector.hpc_load(checkpoint_path)