summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-09 01:57:41 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-09 01:57:41 -0700
commitaeaceebd2f4a93056533d3bb340bc2c55cd5a691 (patch)
treea60596c789eafb4964bf58f46d5e5b189013979c
parent14ffb5c29f748114dd529d0c20e3c5fe6d953b5f (diff)
downloadportage-aeaceebd2f4a93056533d3bb340bc2c55cd5a691.tar.gz
portage-aeaceebd2f4a93056533d3bb340bc2c55cd5a691.tar.bz2
portage-aeaceebd2f4a93056533d3bb340bc2c55cd5a691.zip
Call portage._disable_legacy_globals() in order to ensure that we
don't instantiate portage.settings, so that tests should work the same regardless of global configuration file state/existence.
-rwxr-xr-xpym/portage/tests/runTests7
1 files changed, 7 insertions, 0 deletions
diff --git a/pym/portage/tests/runTests b/pym/portage/tests/runTests
index 8e8a3a443..a6f3b8f1c 100755
--- a/pym/portage/tests/runTests
+++ b/pym/portage/tests/runTests
@@ -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():