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>
This commit is contained in:
parent
85c80542a5
commit
22e478d203
1 changed files with 3 additions and 3 deletions
|
@ -51,14 +51,14 @@ class pmenv(object):
|
||||||
"""
|
"""
|
||||||
if not os.path.isfile(testcase):
|
if not os.path.isfile(testcase):
|
||||||
raise IOError("test file %s not found" % testcase)
|
raise IOError("test file %s not found" % testcase)
|
||||||
test = pmtest.pmtest(testcase, self.root)
|
self.testcases.append(testcase)
|
||||||
self.testcases.append(test)
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""
|
"""
|
||||||
"""
|
"""
|
||||||
tap.plan(len(self.testcases))
|
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)
|
tap.diag("Running '%s'" % t.testname)
|
||||||
|
|
||||||
t.load()
|
t.load()
|
||||||
|
|
Loading…
Add table
Reference in a new issue