Skip to content

Commit 99614d0

Browse files
committed
tester: fix tests.include handling
Empty string split by ',' will be an array with a single element. i.e. ['']. The code later on tests if len(include) == 0 For that to work we need an empty array. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d201f39 commit 99614d0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/tester.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
def load_tests(config, name):
1616
core.log_open_sec(name.capitalize() + " tests")
1717
tests_subdir = os.path.join(config.get('dirs', 'tests'), name)
18-
include = [x.strip() for x in config.get('tests', 'include', fallback="").split(',')]
18+
try:
19+
include = [x.strip() for x in config.get('tests', 'include').split(',')]
20+
except (configparser.NoSectionError, configparser.NoOptionError):
21+
include = []
1922
exclude = [x.strip() for x in config.get('tests', 'exclude', fallback="").split(',')]
2023
tests = []
2124
for td in os.listdir(tests_subdir):

0 commit comments

Comments
 (0)