    def test_button_text(self):
        """
        Check Button text can be set as an attribute.
        """
        def _on_click():
            pass

        btn = Button("Before", _on_click)
        self.assertEqual(btn.text, "Before")
        btn.text = "After"
        self.assertEqual(btn.text, "After")
Check Button text can be set as an attribute.
tests/test_widgets.py