Skip to content

Commit a2a3ffb

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3769baa commit a2a3ffb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/lightning/pytorch/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,9 @@ def parse_arguments(self, parser: LightningArgumentParser, args: ArgsType) -> No
554554
def _dump_config(self) -> None:
555555
if hasattr(self, "config_dump"):
556556
return
557-
self.config_dump = yaml.safe_load(self.parser.dump(self.config, skip_link_targets=False, skip_none=False, format="yaml"))
557+
self.config_dump = yaml.safe_load(
558+
self.parser.dump(self.config, skip_link_targets=False, skip_none=False, format="yaml")
559+
)
558560
if "subcommand" in self.config:
559561
self.config_dump = self.config_dump[self.config.subcommand]
560562

tests/tests_pytorch/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,11 +1859,11 @@ def test_lightning_cli_args_and_sys_argv_warning():
18591859
with mock.patch("sys.argv", ["", "--model.foo=456"]), pytest.warns(Warning, match="LightningCLI's args parameter "):
18601860
LightningCLI(TestModel, run=False, args=["--model.foo=789"])
18611861

1862+
18621863
def test_lightning_cli_jsonnet(cleandir):
18631864
class MainModule(BoringModel):
18641865
def __init__(self, main_param: int = 1):
18651866
super().__init__()
1866-
18671867

18681868
config = """{
18691869
"model":{
@@ -1877,4 +1877,4 @@ def __init__(self, main_param: int = 1):
18771877
with mock.patch("sys.argv", ["any.py"] + cli_args):
18781878
cli = LightningCLI(MainModule, run=False, parser_kwargs={"parser_mode": "jsonnet"})
18791879

1880-
assert cli.config["model"]["main_param"] == 2
1880+
assert cli.config["model"]["main_param"] == 2

0 commit comments

Comments
 (0)