summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/__init__.py3
-rw-r--r--test/tc_directory.py5
-rw-r--r--test/tc_history.py5
3 files changed, 5 insertions, 8 deletions
diff --git a/test/__init__.py b/test/__init__.py
index 4f1c736a..500d3383 100644
--- a/test/__init__.py
+++ b/test/__init__.py
@@ -3,3 +3,6 @@ import os, sys
 __all__ = [ x[0:x.index('.')] \
 		for x in os.listdir(os.path.dirname(__file__)) \
 		if x.startswith('tc_') ]
+
+def init():
+	sys.path.append(os.path.abspath(os.path.join(sys.path[0], '..')))
diff --git a/test/tc_directory.py b/test/tc_directory.py
index 434d282f..cb8e747e 100644
--- a/test/tc_directory.py
+++ b/test/tc_directory.py
@@ -1,7 +1,4 @@
-if __name__ == '__main__':
-	from os.path import abspath, join
-	import sys
-	sys.path.append(abspath(join(sys.path[0], '..')))
+if __name__ == '__main__': from __init__ import init; init()
 
 from ranger import fsobject
 from ranger.fsobject.file import File
diff --git a/test/tc_history.py b/test/tc_history.py
index e78af0aa..ad340992 100644
--- a/test/tc_history.py
+++ b/test/tc_history.py
@@ -1,7 +1,4 @@
-if __name__ == '__main__':
-	from os.path import abspath, join
-	import sys
-	sys.path.append(abspath(join(sys.path[0], '..')))
+if __name__ == '__main__': from __init__ import init; init()
 
 from ranger.container import History
 from unittest import TestCase, main