# Distributed under the terms of the GNU General Public License v2
from itertools import chain
+import shutil
import tempfile
import portage
from portage import os
else:
#TODO: Use mydepgraph.display_problems() to return a useful error message
return False, None
+
+ def cleanup(self):
+ shutil.rmtree(self.root)
)
playground = ResolverPlayground(ebuilds=ebuilds)
-
- for atoms, options, action, expected_result, expected_mergelist in requests:
- success, mergelist = playground.run(atoms, options, action)
- self.assertEqual((success, mergelist), (expected_result, expected_mergelist))
+ try:
+ for atoms, options, action, \
+ expected_result, expected_mergelist in requests:
+ success, mergelist = playground.run(atoms, options, action)
+ self.assertEqual((success, mergelist),
+ (expected_result, expected_mergelist))
+ finally:
+ playground.cleanup()
)
playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)
-
- for atoms, options, action, expected_result, expected_mergelist in requests:
- success, mergelist = playground.run(atoms, options, action)
- self.assertEqual((success, mergelist), (expected_result, expected_mergelist))
+ try:
+ for atoms, options, action, \
+ expected_result, expected_mergelist in requests:
+ success, mergelist = playground.run(atoms, options, action)
+ self.assertEqual((success, mergelist),
+ (expected_result, expected_mergelist))
+ finally:
+ playground.cleanup()