Commit 95cc64db authored by Johan Gudmundsson's avatar Johan Gudmundsson
Browse files

test to ensure we pop attr from dict

parent c2136419
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -362,3 +362,12 @@ def test_observed_del(observed):
def test_forward_on_observed_raises_error(observed):
    with pytest.raises(RuntimeError):
        observed()



def test_set_rv_overwrites_attr_in_dict():
    model = module.Module()
    model.test = 1
    assert model.__dict__['test'] ==1
    model.test = dist.Normal(0, 1)
    assert 'test' not in model.__dict__