Browse Source

exec_wrapper.py: `sys.path` fixup for test scripts

The MMGen Project 1 year ago
parent
commit
31390cfa33
2 changed files with 3 additions and 6 deletions
  1. 1 0
      scripts/exec_wrapper.py
  2. 2 6
      test/test.py

+ 1 - 0
scripts/exec_wrapper.py

@@ -19,6 +19,7 @@ def exec_wrapper_init():
 		exec_wrapper_sys.path[1] = cwd
 		from test.overlay import get_overlay_tree_dir
 		exec_wrapper_sys.path[0] = get_overlay_tree_dir(cwd)
+		exec_wrapper_sys.path.insert(2, exec_wrapper_os.path.join(cwd,'test'))
 	else:
 		exec_wrapper_sys.path.pop(0)
 

+ 2 - 6
test/test.py

@@ -85,12 +85,8 @@ if sys.argv[-1] == 'clean':
 	print(f'Removed {os.path.relpath(overlay_tree_dir)!r}')
 else:
 	# overlay must be set up before importing mmgen mods!
-	try:
-		import include.test_init
-		repo_root = include.test_init.repo_root
-	except ModuleNotFoundError: # allow running under exec_wrapper
-		import test.include.test_init
-		repo_root = test.include.test_init.repo_root
+	import include.test_init
+	repo_root = include.test_init.repo_root
 
 from mmgen.common import *