From 0cc96af15290a49057d24744efe0d9689ab13d39 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Mon, 25 Sep 2023 13:25:00 +0000 Subject: [PATCH] test suite: PYTHONPATH and other env var fixes --- test/objattrtest.py | 5 +---- test/objtest.py | 2 -- test/test-release.sh | 4 ---- test/test.py | 6 +++--- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/test/objattrtest.py b/test/objattrtest.py index ed109a5d..f71d3cfa 100755 --- a/test/objattrtest.py +++ b/test/objattrtest.py @@ -23,11 +23,8 @@ test/objattrtest.py: Test immutable attributes of MMGen data objects # TODO: test 'typeconv' during instance creation 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 from mmgen.common import * diff --git a/test/objtest.py b/test/objtest.py index 44979faa..f99097a1 100755 --- a/test/objtest.py +++ b/test/objtest.py @@ -29,8 +29,6 @@ sys.path.insert(0,overlay_setup(repo_root)) from mmgen.devinit import init_dev init_dev() -os.environ['MMGEN_TEST_SUITE'] = '1' - # Import these _after_ local path's been added to sys.path from mmgen.common import * from mmgen.obj import * diff --git a/test/test-release.sh b/test/test-release.sh index ebb4aee2..027c3787 100755 --- a/test/test-release.sh +++ b/test/test-release.sh @@ -131,10 +131,6 @@ trap 'echo -e "${GREEN}Exiting at user request$RESET"; exit' INT umask 0022 -export MMGEN_TEST_SUITE=1 -export MMGEN_NO_LICENSE=1 -export PYTHONPATH=. - test_py='test/test.py -n' objtest_py='test/objtest.py' objattrtest_py='test/objattrtest.py' diff --git a/test/test.py b/test/test.py index 950701be..4754d67f 100755 --- a/test/test.py +++ b/test/test.py @@ -201,6 +201,9 @@ cfg.skipping_deps = cfg.resuming or 'skip_deps' in po.user_opts cmd_args = cfg._args +if not cfg.system: + os.environ['PYTHONPATH'] = repo_root + if cfg.pexpect_spawn and gc.platform == 'win': die(1,'--pexpect-spawn option not supported on Windows platform, exiting') @@ -575,9 +578,6 @@ class TestSuiteRunner(object): else: self.spawn_env['MMGEN_COLUMNS'] = '120' - if not cfg.system: - self.spawn_env['PYTHONPATH'] = repo_root - def spawn_wrapper(self,cmd, args = [], extra_desc = '',