summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorpierre-yves david <pierre-yves.david@insa-lyon.fr>2008-06-29 13:13:35 +0200
committerpierre-yves david <pierre-yves.david@insa-lyon.fr>2008-06-29 13:13:35 +0200
commit3daf637c8ad412afe43c683b74d714f30185388f (patch)
treeb513472a6e5a5f38c91e02c26d75b92d93cf5257 /test
parente0f736ee1ae21a49a38c36b0053ec2889e10ac4b (diff)
downloadlogilab-common-3daf637c8ad412afe43c683b74d714f30185388f.tar.gz
remove common path from test only if present
Diffstat (limited to 'test')
-rw-r--r--test/unittest_modutils.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/unittest_modutils.py b/test/unittest_modutils.py
index b21383f..09ec232 100644
--- a/test/unittest_modutils.py
+++ b/test/unittest_modutils.py
@@ -35,10 +35,13 @@ DATADIR = path.join(path.dirname(__file__), 'data')
class TestCase(TLTestCase):
def setUp(self):
super(TestCase,self).setUp()
- sys.path.remove(common.__path__[0])
+ self.__common_in_path = common.__path__[0] in sys.path
+ if self.__common_in_path:
+ sys.path.remove(common.__path__[0])
def tearDown(self):
- sys.path.insert(0, common.__path__[0])
+ if self.__common_in_path:
+ sys.path.insert(0, common.__path__[0])
super(TestCase,self).tearDown()