Skip to content

Commit d61b9ec

Browse files
committed
asset called with none
1 parent 436552d commit d61b9ec

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

tests/tests_pytorch/plugins/test_checkpoint_io_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_checkpoint_plugin_called(tmp_path):
6969
assert checkpoint_plugin.remove_checkpoint.call_count == 1
7070

7171
trainer.test(model, ckpt_path=ck.last_model_path)
72-
checkpoint_plugin.load_checkpoint.assert_called_with(str(tmp_path / "last.ckpt"), weights_only=False)
72+
checkpoint_plugin.load_checkpoint.assert_called_with(str(tmp_path / "last.ckpt"), weights_only=None)
7373

7474
checkpoint_plugin.reset_mock()
7575
ck = ModelCheckpoint(dirpath=tmp_path, save_last=True)
@@ -97,7 +97,7 @@ def test_checkpoint_plugin_called(tmp_path):
9797

9898
trainer.test(model, ckpt_path=ck.last_model_path)
9999
checkpoint_plugin.load_checkpoint.assert_called_once()
100-
checkpoint_plugin.load_checkpoint.assert_called_with(str(tmp_path / "last-v1.ckpt"), weights_only=False)
100+
checkpoint_plugin.load_checkpoint.assert_called_with(str(tmp_path / "last-v1.ckpt"), weights_only=None)
101101

102102

103103
@pytest.mark.flaky(reruns=3)

tests/tests_pytorch/test_cli.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,7 @@ def test_lightning_cli_config_with_subcommand():
14471447
):
14481448
cli = LightningCLI(BoringModel)
14491449

1450-
test_mock.assert_called_once_with(cli.trainer, cli.model, verbose=True, ckpt_path="foobar", weights_only=False)
1450+
test_mock.assert_called_once_with(cli.trainer, cli.model, verbose=True, ckpt_path="foobar", weights_only=None)
14511451
assert cli.trainer.limit_test_batches == 1
14521452

14531453

@@ -1463,9 +1463,7 @@ def test_lightning_cli_config_before_subcommand():
14631463
):
14641464
cli = LightningCLI(BoringModel)
14651465

1466-
test_mock.assert_called_once_with(
1467-
cli.trainer, model=cli.model, verbose=True, ckpt_path="foobar", weights_only=False
1468-
)
1466+
test_mock.assert_called_once_with(cli.trainer, model=cli.model, verbose=True, ckpt_path="foobar", weights_only=None)
14691467
assert cli.trainer.limit_test_batches == 1
14701468

14711469
save_config_callback = cli.trainer.callbacks[0]
@@ -1478,7 +1476,7 @@ def test_lightning_cli_config_before_subcommand():
14781476
):
14791477
cli = LightningCLI(BoringModel)
14801478

1481-
validate_mock.assert_called_once_with(cli.trainer, cli.model, verbose=False, ckpt_path="barfoo", weights_only=False)
1479+
validate_mock.assert_called_once_with(cli.trainer, cli.model, verbose=False, ckpt_path="barfoo", weights_only=None)
14821480
assert cli.trainer.limit_val_batches == 1
14831481

14841482
save_config_callback = cli.trainer.callbacks[0]
@@ -1496,9 +1494,7 @@ def test_lightning_cli_config_before_subcommand_two_configs():
14961494
):
14971495
cli = LightningCLI(BoringModel)
14981496

1499-
test_mock.assert_called_once_with(
1500-
cli.trainer, model=cli.model, verbose=True, ckpt_path="foobar", weights_only=False
1501-
)
1497+
test_mock.assert_called_once_with(cli.trainer, model=cli.model, verbose=True, ckpt_path="foobar", weights_only=None)
15021498
assert cli.trainer.limit_test_batches == 1
15031499

15041500
with (
@@ -1507,7 +1503,7 @@ def test_lightning_cli_config_before_subcommand_two_configs():
15071503
):
15081504
cli = LightningCLI(BoringModel)
15091505

1510-
validate_mock.assert_called_once_with(cli.trainer, cli.model, verbose=False, ckpt_path="barfoo", weights_only=False)
1506+
validate_mock.assert_called_once_with(cli.trainer, cli.model, verbose=False, ckpt_path="barfoo", weights_only=None)
15111507
assert cli.trainer.limit_val_batches == 1
15121508

15131509

@@ -1519,7 +1515,7 @@ def test_lightning_cli_config_after_subcommand():
15191515
):
15201516
cli = LightningCLI(BoringModel)
15211517

1522-
test_mock.assert_called_once_with(cli.trainer, cli.model, verbose=True, ckpt_path="foobar", weights_only=False)
1518+
test_mock.assert_called_once_with(cli.trainer, cli.model, verbose=True, ckpt_path="foobar", weights_only=None)
15231519
assert cli.trainer.limit_test_batches == 1
15241520

15251521

@@ -1533,7 +1529,7 @@ def test_lightning_cli_config_before_and_after_subcommand():
15331529
cli = LightningCLI(BoringModel)
15341530

15351531
test_mock.assert_called_once_with(
1536-
cli.trainer, model=cli.model, verbose=False, ckpt_path="foobar", weights_only=False
1532+
cli.trainer, model=cli.model, verbose=False, ckpt_path="foobar", weights_only=None
15371533
)
15381534
assert cli.trainer.limit_test_batches == 1
15391535
assert cli.trainer.fast_dev_run == 1

0 commit comments

Comments
 (0)