Skip to content

Commit

Permalink
namespace_to_dict -> as_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
a-gardner1 committed Oct 10, 2024
1 parent a9b23bf commit e1739ed
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions jsonargparse_tests/test_typehints.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import yaml

from jsonargparse import ArgumentError, Namespace, lazy_instance
from jsonargparse._namespace import namespace_to_dict
from jsonargparse._typehints import (
ActionTypeHint,
NotRequired,
Expand Down Expand Up @@ -663,7 +662,7 @@ def test_valid_unpack_typeddict_by_assumptions(parser, init_args):
parser.add_argument("--testclass", type=MyTestInheritedUnpackClass)
test_config = {"class_path": f"{__name__}.MyTestInheritedUnpackClass", "init_args": init_args}
cfg = parser.parse_args([f"--testclass={json.dumps(test_config)}"])
assert test_config == namespace_to_dict(cfg["testclass"])
assert test_config == cfg["testclass"].as_dict()
# also assert no issues with dumping
if test_config["init_args"].get("b") is None:
# parser.dump does not dump null b
Expand Down

0 comments on commit e1739ed

Please sign in to comment.