()
| 778 | |
| 779 | |
| 780 | def test_deep_alias(): |
| 781 | from traitlets import Int |
| 782 | from traitlets.config import Application, Configurable |
| 783 | |
| 784 | class Foo(Configurable): |
| 785 | val = Int(default_value=5).tag(config=True) |
| 786 | |
| 787 | class Bar(Configurable): |
| 788 | def __init__(self, *args, **kwargs): |
| 789 | super().__init__(*args, **kwargs) |
| 790 | self.foo = Foo(parent=self) |
| 791 | |
| 792 | class TestApp(Application): |
| 793 | name = "test" |
| 794 | |
| 795 | aliases = {"val": "Bar.Foo.val"} |
| 796 | classes = [Foo, Bar] |
| 797 | |
| 798 | def initialize(self, *args, **kwargs): |
| 799 | super().initialize(*args, **kwargs) |
| 800 | self.bar = Bar(parent=self) |
| 801 | |
| 802 | app = TestApp() |
| 803 | app.initialize(["--val=10"]) |
| 804 | assert app.bar.foo.val == 10 |
| 805 | assert len(list(app.emit_alias_help())) > 0 |
| 806 | |
| 807 | |
| 808 | def test_logging_config(tmp_path, capsys): |
nothing calls this directly
no test coverage detected
searching dependent graphs…