From fe17f546b5cd5fd8b9df7d53856efd7b207faa0e Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Mon, 25 Sep 2017 17:19:09 +0200 Subject: Don't set defaults that will always be overwritten The constructors previously defaulted all properties. This is dead code for properties that are always set on items from outside during parsing, and obfuscates the code flow and wastes time. Instead, just mention other properties that exist in comments in the constructors. Also add test cases for missing and empty 'choice' help texts. Removing the default 'self._help = None' assignment in Choice.__init__() wasn't caught by the selftests. --- tests/Ktext | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/Ktext b/tests/Ktext index 599cd36..3440c3c 100644 --- a/tests/Ktext +++ b/tests/Ktext @@ -80,11 +80,21 @@ endif config NO_HELP bool +choice NO_HELP_CHOICE +config FOO +endchoice + config EMPTY_HELP bool help config DUMMY +choice EMPTY_HELP_CHOICE + bool + help +config DUMMY2 +endchoice + config S bool help -- cgit v1.2.3