mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
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
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user