From 8f70520823187ffa4c8afd9a53e1aae43a5df6e2 Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Tue, 24 Nov 2015 14:58:55 +0000 Subject: [PATCH] autopkgtest: Don't repeat "ever_passed" check We can just add a default value before the "try" block and then use that as the default (no results) case. --- autopkgtest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autopkgtest.py b/autopkgtest.py index bc9e2a2..a4c3858 100644 --- a/autopkgtest.py +++ b/autopkgtest.py @@ -662,6 +662,8 @@ class AutoPackageTest(object): for arch in self.britney.options.adt_arches: for testsrc, testver in self.tests_for_source(trigsrc, trigver, arch): + # by default, assume that we has never passed (i.e. this is the first run) + ever_passed = False try: (_, ver_map, ever_passed) = self.test_results[testsrc][arch] @@ -702,8 +704,6 @@ class AutoPackageTest(object): # no result for testsrc/testver/arch; still running? try: self.pending_tests[testsrc][testver][arch] - # if we can't find a result, assume that it has never passed (i.e. this is the first run) - (_, _, ever_passed) = self.test_results.get(testsrc, {}).get(arch, (None, None, False)) if ever_passed: result = 'RUNNING'