Browse Source

test suite: PYTHONPATH and other env var fixes

The MMGen Project 1 year ago
parent
commit
0cc96af152
4 changed files with 4 additions and 13 deletions
  1. 1 4
      test/objattrtest.py
  2. 0 2
      test/objtest.py
  3. 0 4
      test/test-release.sh
  4. 3 3
      test/test.py

+ 1 - 4
test/objattrtest.py

@@ -23,11 +23,8 @@ test/objattrtest.py: Test immutable attributes of MMGen data objects
 # TODO: test 'typeconv' during instance creation
 # TODO: test 'typeconv' during instance creation
 
 
 import sys,os
 import sys,os
-pn = os.path.dirname(sys.argv[0])
-os.chdir(os.path.join(pn,os.pardir))
-sys.path.__setitem__(0,os.path.abspath(os.curdir))
 
 
-os.environ['MMGEN_TEST_SUITE'] = '1'
+from include.tests_header import repo_root
 
 
 # Import these _after_ local path's been added to sys.path
 # Import these _after_ local path's been added to sys.path
 from mmgen.common import *
 from mmgen.common import *

+ 0 - 2
test/objtest.py

@@ -29,8 +29,6 @@ sys.path.insert(0,overlay_setup(repo_root))
 from mmgen.devinit import init_dev
 from mmgen.devinit import init_dev
 init_dev()
 init_dev()
 
 
-os.environ['MMGEN_TEST_SUITE'] = '1'
-
 # Import these _after_ local path's been added to sys.path
 # Import these _after_ local path's been added to sys.path
 from mmgen.common import *
 from mmgen.common import *
 from mmgen.obj import *
 from mmgen.obj import *

+ 0 - 4
test/test-release.sh

@@ -131,10 +131,6 @@ trap 'echo -e "${GREEN}Exiting at user request$RESET"; exit' INT
 
 
 umask 0022
 umask 0022
 
 
-export MMGEN_TEST_SUITE=1
-export MMGEN_NO_LICENSE=1
-export PYTHONPATH=.
-
 test_py='test/test.py -n'
 test_py='test/test.py -n'
 objtest_py='test/objtest.py'
 objtest_py='test/objtest.py'
 objattrtest_py='test/objattrtest.py'
 objattrtest_py='test/objattrtest.py'

+ 3 - 3
test/test.py

@@ -201,6 +201,9 @@ cfg.skipping_deps = cfg.resuming or 'skip_deps' in po.user_opts
 
 
 cmd_args = cfg._args
 cmd_args = cfg._args
 
 
+if not cfg.system:
+	os.environ['PYTHONPATH'] = repo_root
+
 if cfg.pexpect_spawn and gc.platform == 'win':
 if cfg.pexpect_spawn and gc.platform == 'win':
 	die(1,'--pexpect-spawn option not supported on Windows platform, exiting')
 	die(1,'--pexpect-spawn option not supported on Windows platform, exiting')
 
 
@@ -575,9 +578,6 @@ class TestSuiteRunner(object):
 		else:
 		else:
 			self.spawn_env['MMGEN_COLUMNS'] = '120'
 			self.spawn_env['MMGEN_COLUMNS'] = '120'
 
 
-		if not cfg.system:
-			self.spawn_env['PYTHONPATH'] = repo_root
-
 	def spawn_wrapper(self,cmd,
 	def spawn_wrapper(self,cmd,
 			args         = [],
 			args         = [],
 			extra_desc   = '',
 			extra_desc   = '',