Skip to content

Commit

Permalink
Test that name and description can be set via constructor. (#826)
Browse files Browse the repository at this point in the history
Alternative to #825, that adds tests for behavior.

I don't think we _need_ the ability to set the value via a constructor,
And I'm generally in favor of simplifying, but at least this should have
tests.
  • Loading branch information
Carreau authored Jan 30, 2023
1 parent d2fbecc commit c11a4d9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions traitlets/config/tests/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ def test_basic(self):
self.assertEqual(app.classes, [MyApp, Bar, Foo]) # type:ignore
self.assertEqual(app.config_file, "")

def test_app_name_set_via_constructor(self):
app = MyApp(name='set_via_constructor')
assert app.name == "set_via_constructor"

def test_mro_discovery(self):
app = MyApp()

Expand Down

0 comments on commit c11a4d9

Please sign in to comment.