diff tests/test_util.py @ 644:95abc4cfc78f

tests: improve import logic We already had some logic some logic to make us import the local modules, but it failed under certain circumstances. I suspect that it had to do with absolute vs. relative paths. Regardless of what the root cause was, this fixes it.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Wed, 14 Jul 2010 15:39:21 +0200
parents 8e621dbb82d4
children 3cb5042531fb
line wrap: on
line diff
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -12,7 +12,8 @@ import tempfile
 import unittest
 import urllib
 
-import __init__
+_rootdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+sys.path.insert(0, _rootdir)
 
 from mercurial import commands
 from mercurial import context