Skip to content

Commit

Permalink
Small fix in test_cli.py to avoid failure with future version of json…
Browse files Browse the repository at this point in the history
…argparse (#16156)
  • Loading branch information
mauvilsa authored Dec 21, 2022
1 parent 0630444 commit 50331e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/tests_pytorch/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ def configure_optimizers(self, optimizer, lr_scheduler=None):
[optimizer], [scheduler] = cli.model.configure_optimizers()
assert isinstance(optimizer, SGD)
assert isinstance(scheduler, StepLR)
with mock.patch("sys.argv", ["any.py", "--lr_scheduler=StepLR"]):
with mock.patch("sys.argv", ["any.py", "--lr_scheduler=StepLR", "--lr_scheduler.step_size=50"]):
cli = MyCLI()
[optimizer], [scheduler] = cli.model.configure_optimizers()
assert isinstance(optimizer, SGD)
Expand Down

0 comments on commit 50331e0

Please sign in to comment.