diff --git a/tests/test_decorators.py b/tests/test_decorators.py index 14fccfa..5edece9 100644 --- a/tests/test_decorators.py +++ b/tests/test_decorators.py @@ -125,6 +125,24 @@ def compute(p1, p2): self.assertEqual(compute(), 111) + def test_class_constructor(self): + Section('sec1').params( + p1=Param(int), + ) + + class TestClass: + + @param('sec1.p1', 'value') + def __init__(self, value): + self.value = value + + get_current_config().collect({ + 'sec1.p1': 42, + }) + + self.assertEqual(TestClass().value, 42) + + def test_do_not_complain_not_missing_args(self): @param('sec1.p1') def compute(p1):