From 4e0dccc9f580522a6bf1feadb688dccbfc051cef Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Mon, 11 Jun 2018 15:11:54 -0700 Subject: [PATCH] test-bots: Make bots_to_test a set, ensuring tests are not duplicated. The previous style was causing duplicate tests for the dropbox_share bot for the unittest runner, due to globbing of test_*.py giving duplicates. However, it also avoids unintentional duplication of bot names to test on the command line being tested multiple times, though again only with the unittest runner. --- tools/test-bots | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/test-bots b/tools/test-bots index 6f48fd7..8295c06 100755 --- a/tools/test-bots +++ b/tools/test-bots @@ -87,7 +87,9 @@ def main(): else: specified_bots = available_bots - bots_to_test = filter(lambda bot: bot not in options.exclude, specified_bots) + # Use of a set ensures we don't end up with duplicate tests with unittest + # (from globbing multiple test_*.py files, or multiple on the command line) + bots_to_test = {bot for bot in specified_bots if bot not in options.exclude} if options.pytest: excluded_bots = ['merels']