Call portage._disable_legacy_globals() in order to ensure that we
authorZac Medico <zmedico@gentoo.org>
Mon, 9 Aug 2010 08:57:41 +0000 (01:57 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 9 Aug 2010 08:57:41 +0000 (01:57 -0700)
don't instantiate portage.settings, so that tests should work the
same regardless of global configuration file state/existence.

pym/portage/tests/runTests

index 8e8a3a44321e2dbbbab50b019c4faeaf368c47db..a6f3b8f1c6051312e1f85d479852276b4369786b 100755 (executable)
@@ -10,6 +10,12 @@ import os.path as osp
 # This line courtesy of Marienz and Pkgcore ;)
 sys.path.insert(0, osp.dirname(osp.dirname(osp.dirname(osp.abspath(__file__)))))
 
+import portage
+
+# Ensure that we don't instantiate portage.settings, so that tests should
+# work the same regardless of global configuration file state/existence.
+portage._disable_legacy_globals()
+
 import portage.tests as tests
 from portage.const import PORTAGE_BIN_PATH
 path = os.environ.get("PATH", "").split(":")
@@ -19,6 +25,7 @@ if not path or not os.path.samefile(path[0], PORTAGE_BIN_PATH):
        os.environ["PATH"] = ":".join(path)
 del path
 
+
 if __name__ == "__main__":
        result = tests.main()
        if not result.wasSuccessful():