Skip to content

Commit 999ef5c

Browse files
awaelchlipre-commit-ci[bot]Borda
authored
move deprecation test to correct 1.6 test file (#8446)
* move deprecation test to correct 1.6 test file * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update tests/deprecated_api/test_remove_1-6.py Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec <[email protected]>
1 parent 1bfa29a commit 999ef5c

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

tests/deprecated_api/test_remove_1-4.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,10 @@
1515

1616
import pytest
1717

18-
from pytorch_lightning import Trainer
1918
from tests.deprecated_api import _soft_unimport_module
20-
from tests.helpers import BoringModel
2119

2220

2321
def test_v1_4_0_deprecated_imports():
2422
_soft_unimport_module('pytorch_lightning.utilities.argparse_utils')
2523
with pytest.deprecated_call(match='will be removed in v1.4'):
2624
from pytorch_lightning.utilities.argparse_utils import _gpus_arg_default # noqa: F811 F401
27-
28-
29-
def test_v1_4_0_deprecated_hpc_load(tmpdir):
30-
model = BoringModel()
31-
trainer = Trainer(
32-
default_root_dir=tmpdir,
33-
max_steps=1,
34-
)
35-
trainer.fit(model)
36-
trainer.checkpoint_connector.hpc_save(tmpdir, trainer.logger)
37-
checkpoint_path = trainer.checkpoint_connector.get_max_ckpt_path_from_folder(str(tmpdir))
38-
with pytest.deprecated_call(match=r"`CheckpointConnector.hpc_load\(\)` was deprecated in v1.4"):
39-
trainer.checkpoint_connector.hpc_load(checkpoint_path)

tests/deprecated_api/test_remove_1-6.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,3 +309,16 @@ def test_v1_6_0_deprecated_disable_validation():
309309
def test_v1_6_0_every_n_val_epochs():
310310
with pytest.deprecated_call(match="use `every_n_epochs` instead"):
311311
_ = ModelCheckpoint(every_n_val_epochs=1)
312+
313+
314+
def test_v1_6_0_deprecated_hpc_load(tmpdir):
315+
model = BoringModel()
316+
trainer = Trainer(
317+
default_root_dir=tmpdir,
318+
max_steps=1,
319+
)
320+
trainer.fit(model)
321+
trainer.checkpoint_connector.hpc_save(tmpdir, trainer.logger)
322+
checkpoint_path = trainer.checkpoint_connector.get_max_ckpt_path_from_folder(str(tmpdir))
323+
with pytest.deprecated_call(match=r"`CheckpointConnector.hpc_load\(\)` was deprecated in v1.4"):
324+
trainer.checkpoint_connector.hpc_load(checkpoint_path)

0 commit comments

Comments
 (0)