Skip to content

Commit

Permalink
test param.objects before initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
maximlt committed Jul 19, 2023
1 parent 69eb0b3 commit f56f4c9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/testparameterizedobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,20 @@ def __init__(self, batched=True, **params):
b = B()
assert b.batched is True

def test_instantiation_param_objects_before_super_subclass(self):
# Testing https://github.com/holoviz/param/pull/420


class P(param.Parameterized):
x = param.Parameter()

def __init__(self):
objs = self.param.objects(instance='existing')
assert isinstance(objs, dict)
super().__init__()

P()

@pytest.mark.xfail(
raises=AttributeError,
reason='Behavior not defined when setting a constant parameter before calling super()',
Expand Down

0 comments on commit f56f4c9

Please sign in to comment.