From 6850ccf8c704ad6859f48a000ca4db0881ca4dc0 Mon Sep 17 00:00:00 2001 From: Omry Yadan Date: Sat, 30 Jan 2021 18:25:16 -0800 Subject: [PATCH] adding failing test --- tests/test_basic_ops_dict.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_basic_ops_dict.py b/tests/test_basic_ops_dict.py index 45509527a..f9beebae9 100644 --- a/tests/test_basic_ops_dict.py +++ b/tests/test_basic_ops_dict.py @@ -811,3 +811,12 @@ def test_self_assign_list_value_with_ref_type(c: Any) -> None: cfg = OmegaConf.create(c) cfg.a = cfg.a assert cfg == c + + +def test_assign_to_sc_field_without_ref_type(): + cfg = OmegaConf.create({"plugin": ConcretePlugin}) + with pytest.raises(ValidationError): + cfg.plugin.params.foo = "bar" + + cfg.plugin = 10 + assert cfg.plugin == 10