changeset 3926:44bd12641293

merge main
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 01 Aug 2008 00:10:23 +0200
parents 44d856f8a110 (current diff) 49bb3b6e3ab5 (diff)
children 2044213dcb13
files
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/maketestwiki.py	Fri Aug 01 00:08:13 2008 +0200
+++ b/MoinMoin/_tests/maketestwiki.py	Fri Aug 01 00:10:23 2008 +0200
@@ -14,7 +14,6 @@
 
 filename = globals().get("__file__") or sys.argv[0]
 moinpath = os.path.abspath(os.path.join(os.path.dirname(filename), os.pardir, os.pardir))
-sys.path.insert(0, moinpath)
 
 from MoinMoin.support import tarfile
 
@@ -62,5 +61,6 @@
     untarUnderlay()
 
 if __name__ == '__main__':
+    sys.path.insert(0, moinpath)
     run()
 
--- a/MoinMoin/conftest.py	Fri Aug 01 00:08:13 2008 +0200
+++ b/MoinMoin/conftest.py	Fri Aug 01 00:10:23 2008 +0200
@@ -33,7 +33,7 @@
 from MoinMoin._tests import maketestwiki, compat
 modules["unittest"] = compat # evil hack
 
-sys.path.insert(0, str(moindir.join("tests")))
+wikiconfig_dir = str(moindir.join("tests"))
 
 from MoinMoin.support.python_compatibility import set
 
@@ -77,6 +77,9 @@
     if not static_state[0]:
         maketestwiki.run(True)
         static_state[0] = True
+    if sys.path[0] != wikiconfig_dir:
+        sys.path.insert(0, wikiconfig_dir) # this is a race with py.test's collectors
+                                           # because they modify sys.path as well
     request = request_cli.Request()
     request.form = request.args = request.setup_args()
     request.user = User(request)