Use ResolverPlayground for it's config instance, so that we don't
authorZac Medico <zmedico@gentoo.org>
Sat, 7 Aug 2010 00:34:09 +0000 (17:34 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 7 Aug 2010 00:34:09 +0000 (17:34 -0700)
instantiate portage.settings.

pym/portage/tests/ebuild/test_spawn.py

index f37a0c5a3099fcec115580c2b17998cbd2c74e06..bb9fb2623947f48b59d92a5855123000e3a36c71 100644 (file)
@@ -4,16 +4,19 @@
 import codecs
 import errno
 import sys
+from tempfile import mkstemp
 from portage import os
 from portage import _encodings
 from portage import _unicode_encode
+from portage import spawn
 from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import ResolverPlayground
 
 class SpawnTestCase(TestCase):
 
        def testLogfile(self):
-               from portage import settings, spawn
-               from tempfile import mkstemp
+               playground = ResolverPlayground()
+               settings = playground.settings
                logfile = None
                try:
                        fd, logfile = mkstemp()
@@ -42,6 +45,7 @@ class SpawnTestCase(TestCase):
                        # may occur.
                        self.assertEqual(test_string, log_content)
                finally:
+                       playground.cleanup()
                        if logfile:
                                try:
                                        os.unlink(logfile)