From 22e478d20322a1d224fc41866d018d4b8a774057 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Fri, 1 Aug 2014 14:19:46 -0700 Subject: pactest: delay test object creation The actual test object is only used to run the test. Storing test cases as strings limits the test object scope and allows it to be garbage collected, reducing memory usage when multiple tests are run. Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- test/pacman/pmenv.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/pacman/pmenv.py b/test/pacman/pmenv.py index fa864fec..2d887b01 100644 --- a/test/pacman/pmenv.py +++ b/test/pacman/pmenv.py @@ -51,14 +51,14 @@ class pmenv(object): """ if not os.path.isfile(testcase): raise IOError("test file %s not found" % testcase) - test = pmtest.pmtest(testcase, self.root) - self.testcases.append(test) + self.testcases.append(testcase) def run(self): """ """ tap.plan(len(self.testcases)) - for t in self.testcases: + for testcase in self.testcases: + t = pmtest.pmtest(testcase, self.root) tap.diag("Running '%s'" % t.testname) t.load() -- cgit v1.2.3