supporting running from source tree
diff --git a/tests/oft b/tests/oft
index c834b8e..a092943 100755
--- a/tests/oft
+++ b/tests/oft
@@ -124,6 +124,11 @@
 import time
 import os
 
+pydir = os.path.join(os.path.dirname(__file__), '..', 'src', 'python')
+if os.path.exists(os.path.join(pydir, 'oftest')):
+    # Running from source tree
+    sys.path.insert(0, pydir)
+
 import testutils
 
 try: