summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2014-08-01 14:19:46 -0700
committerAllan McRae <allan@archlinux.org>2014-08-04 14:23:58 +1000
commit22e478d20322a1d224fc41866d018d4b8a774057 (patch)
tree6768f5483bbb144d70114cecb3a53e85db7939bf /test
parent85c80542a5c52311fdde71459a924d87ec95cc93 (diff)
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 <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test')
-rw-r--r--test/pacman/pmenv.py6
1 files 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()