From 424ad3f07855d9099945d7ac899a82ce03a116bd Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sat, 27 Oct 2018 16:21:29 +0200 Subject: [PATCH] tests import path: put shipped pmb code first Always test the pmb code from the parent folder of the tests, even if a stable version of pmbootstrap is installed with pip or pysetup. --- test/test_apk_static.py | 2 +- test/test_aportgen.py | 2 +- test/test_aportgen_device_wizard.py | 2 +- test/test_bootimg.py | 2 +- test/test_build_is_necessary.py | 2 +- test/test_build_package.py | 2 +- test/test_buildroot_aarch64_init.py | 2 +- test/test_config_user.py | 2 +- test/test_cross_compile_distcc.py | 2 +- test/test_file.py | 2 +- test/test_folder_size.py | 2 +- test/test_frontend.py | 2 +- test/test_install.py | 2 +- test/test_keys.py | 2 +- test/test_mount.py | 2 +- test/test_newapkbuild.py | 2 +- test/test_parse_apkbuild.py | 2 +- test/test_parse_apkindex.py | 2 +- test/test_parse_depends.py | 2 +- test/test_pkgrel_bump.py | 2 +- test/test_qemu_running_processes.py | 2 +- test/test_questions.py | 2 +- test/test_repo.py | 2 +- test/test_run_core.py | 2 +- test/test_shell_escape.py | 2 +- test/test_version.py | 2 +- test/test_version_validate.py | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/test/test_apk_static.py b/test/test_apk_static.py index 59ddf08a..a6f9da82 100644 --- a/test/test_apk_static.py +++ b/test/test_apk_static.py @@ -24,7 +24,7 @@ import pytest # Import from parent directory pmb_src = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/..")) -sys.path.append(pmb_src) +sys.path.insert(0, pmb_src) import pmb.chroot.apk_static import pmb.config import pmb.parse.apkindex diff --git a/test/test_aportgen.py b/test/test_aportgen.py index 42844b5a..ceaa4040 100644 --- a/test/test_aportgen.py +++ b/test/test_aportgen.py @@ -24,7 +24,7 @@ import filecmp # Import from parent directory pmb_src = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/..")) -sys.path.append(pmb_src) +sys.path.insert(0, pmb_src) import pmb.aportgen import pmb.aportgen.core diff --git a/test/test_aportgen_device_wizard.py b/test/test_aportgen_device_wizard.py index 2ba7e2b5..d67b66ab 100644 --- a/test/test_aportgen_device_wizard.py +++ b/test/test_aportgen_device_wizard.py @@ -22,7 +22,7 @@ import pytest import sys # Import from parent directory -sys.path.append(os.path.realpath( +sys.path.insert(0, os.path.realpath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.aportgen import pmb.config diff --git a/test/test_bootimg.py b/test/test_bootimg.py index 7f051a99..7e979cb2 100644 --- a/test/test_bootimg.py +++ b/test/test_bootimg.py @@ -22,7 +22,7 @@ import pytest # Import from parent directory pmb_src = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/..")) -sys.path.append(pmb_src) +sys.path.insert(0, pmb_src) import pmb.chroot.apk_static import pmb.parse.apkindex import pmb.helpers.logging diff --git a/test/test_build_is_necessary.py b/test/test_build_is_necessary.py index eb704b38..421fe831 100644 --- a/test/test_build_is_necessary.py +++ b/test/test_build_is_necessary.py @@ -21,7 +21,7 @@ import sys import pytest # Import from parent directory -sys.path.append(os.path.realpath( +sys.path.insert(0, os.path.realpath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.build.other import pmb.helpers.logging diff --git a/test/test_build_package.py b/test/test_build_package.py index bbbd7d3c..1bd2c48d 100644 --- a/test/test_build_package.py +++ b/test/test_build_package.py @@ -29,7 +29,7 @@ import shutil import sys # Import from parent directory -sys.path.append(os.path.realpath( +sys.path.insert(0, os.path.realpath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.build import pmb.build._package diff --git a/test/test_buildroot_aarch64_init.py b/test/test_buildroot_aarch64_init.py index bf918478..a59a93f2 100644 --- a/test/test_buildroot_aarch64_init.py +++ b/test/test_buildroot_aarch64_init.py @@ -27,7 +27,7 @@ import pytest import sys # Import from parent directory -sys.path.append(os.path.realpath( +sys.path.insert(0, os.path.realpath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.build import pmb.helpers.logging diff --git a/test/test_config_user.py b/test/test_config_user.py index 7d8483fa..b54bfa83 100644 --- a/test/test_config_user.py +++ b/test/test_config_user.py @@ -21,7 +21,7 @@ import sys import pytest # Import from parent directory -sys.path.append(os.path.realpath( +sys.path.insert(0, os.path.realpath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.aportgen import pmb.config diff --git a/test/test_cross_compile_distcc.py b/test/test_cross_compile_distcc.py index da47d0b8..2059ad74 100644 --- a/test/test_cross_compile_distcc.py +++ b/test/test_cross_compile_distcc.py @@ -22,7 +22,7 @@ import pytest import sys # Import from parent directory -sys.path.append(os.path.realpath( +sys.path.insert(0, os.path.realpath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.build import pmb.chroot.distccd diff --git a/test/test_file.py b/test/test_file.py index 26513fb3..c58ce78d 100644 --- a/test/test_file.py +++ b/test/test_file.py @@ -22,7 +22,7 @@ import time import pytest # Import from parent directory -sys.path.append(os.path.realpath( +sys.path.insert(0, os.path.realpath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.helpers.git import pmb.helpers.logging diff --git a/test/test_folder_size.py b/test/test_folder_size.py index 93fe5b9e..9e4d71d4 100644 --- a/test/test_folder_size.py +++ b/test/test_folder_size.py @@ -21,7 +21,7 @@ import sys import pytest # Import from parent directory -sys.path.append(os.path.abspath( +sys.path.insert(0, os.path.abspath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.helpers.logging import pmb.helpers.other diff --git a/test/test_frontend.py b/test/test_frontend.py index a8963e07..5dcf4265 100644 --- a/test/test_frontend.py +++ b/test/test_frontend.py @@ -21,7 +21,7 @@ import sys import pytest # Import from parent directory -sys.path.append(os.path.realpath( +sys.path.insert(0, os.path.realpath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.config import pmb.parse diff --git a/test/test_install.py b/test/test_install.py index 19ab5a78..7fec5f11 100644 --- a/test/test_install.py +++ b/test/test_install.py @@ -22,7 +22,7 @@ import sys # Import from parent directory pmb_src = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/..")) -sys.path.append(pmb_src) +sys.path.insert(0, pmb_src) import pmb.aportgen.device import pmb.config import pmb.config.init diff --git a/test/test_keys.py b/test/test_keys.py index bc730680..b1ccea5d 100644 --- a/test/test_keys.py +++ b/test/test_keys.py @@ -23,7 +23,7 @@ import glob import filecmp # Import from parent directory -sys.path.append(os.path.realpath( +sys.path.insert(0, os.path.realpath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.parse.apkindex import pmb.helpers.logging diff --git a/test/test_mount.py b/test/test_mount.py index 0f23c0c7..e5bde839 100644 --- a/test/test_mount.py +++ b/test/test_mount.py @@ -20,7 +20,7 @@ import os import sys # Import from parent directory -sys.path.append(os.path.realpath( +sys.path.insert(0, os.path.realpath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.helpers.mount diff --git a/test/test_newapkbuild.py b/test/test_newapkbuild.py index 9d5e0c12..4c22fe99 100644 --- a/test/test_newapkbuild.py +++ b/test/test_newapkbuild.py @@ -22,7 +22,7 @@ import pytest import sys # Import from parent directory -sys.path.append(os.path.realpath( +sys.path.insert(0, os.path.realpath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.build.newapkbuild import pmb.config diff --git a/test/test_parse_apkbuild.py b/test/test_parse_apkbuild.py index e6fbd34d..8167c384 100644 --- a/test/test_parse_apkbuild.py +++ b/test/test_parse_apkbuild.py @@ -23,7 +23,7 @@ import sys # Import from parent directory pmb_src = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/..")) -sys.path.append(pmb_src) +sys.path.insert(0, pmb_src) import pmb.parse._apkbuild diff --git a/test/test_parse_apkindex.py b/test/test_parse_apkindex.py index 7424e2b2..4750aef2 100644 --- a/test/test_parse_apkindex.py +++ b/test/test_parse_apkindex.py @@ -27,7 +27,7 @@ import pytest import sys # Import from parent directory -sys.path.append(os.path.realpath( +sys.path.insert(0, os.path.realpath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.parse.apkindex import pmb.helpers.logging diff --git a/test/test_parse_depends.py b/test/test_parse_depends.py index 0626fc18..dbb0c045 100644 --- a/test/test_parse_depends.py +++ b/test/test_parse_depends.py @@ -27,7 +27,7 @@ import pytest import sys # Import from parent directory -sys.path.append(os.path.realpath( +sys.path.insert(0, os.path.realpath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.config import pmb.config.init diff --git a/test/test_pkgrel_bump.py b/test/test_pkgrel_bump.py index 8d4494c6..2216361a 100644 --- a/test/test_pkgrel_bump.py +++ b/test/test_pkgrel_bump.py @@ -28,7 +28,7 @@ import sys # Import from parent directory pmb_src = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/..")) -sys.path.append(pmb_src) +sys.path.insert(0, pmb_src) import pmb.helpers.pkgrel_bump import pmb.helpers.logging diff --git a/test/test_qemu_running_processes.py b/test/test_qemu_running_processes.py index 011eb3ac..e3f4ef42 100644 --- a/test/test_qemu_running_processes.py +++ b/test/test_qemu_running_processes.py @@ -34,7 +34,7 @@ import time # Import from parent directory pmb_src = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/..")) -sys.path.append(pmb_src) +sys.path.insert(0, pmb_src) import pmb.chroot.apk_static import pmb.parse.apkindex import pmb.helpers.logging diff --git a/test/test_questions.py b/test/test_questions.py index bae6acb5..741f3e77 100644 --- a/test/test_questions.py +++ b/test/test_questions.py @@ -23,7 +23,7 @@ import sys # Import from parent directory pmb_src = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/..")) -sys.path.append(pmb_src) +sys.path.insert(0, pmb_src) import pmb.aportgen.device import pmb.config import pmb.config.init diff --git a/test/test_repo.py b/test/test_repo.py index 9a9da784..b6d3aa67 100644 --- a/test/test_repo.py +++ b/test/test_repo.py @@ -22,7 +22,7 @@ import sys # Import from parent directory pmb_src = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/..")) -sys.path.append(pmb_src) +sys.path.insert(0, pmb_src) import pmb.helpers.repo diff --git a/test/test_run_core.py b/test/test_run_core.py index 18c99a1b..6228c7e1 100644 --- a/test/test_run_core.py +++ b/test/test_run_core.py @@ -28,7 +28,7 @@ import pytest # Import from parent directory pmb_src = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/..")) -sys.path.append(pmb_src) +sys.path.insert(0, pmb_src) import pmb.helpers.run_core diff --git a/test/test_shell_escape.py b/test/test_shell_escape.py index e7c94433..e01c15ac 100644 --- a/test/test_shell_escape.py +++ b/test/test_shell_escape.py @@ -22,7 +22,7 @@ import pytest # Import from parent directory pmb_src = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/..")) -sys.path.append(pmb_src) +sys.path.insert(0, pmb_src) import pmb.chroot.root import pmb.chroot.user import pmb.helpers.run diff --git a/test/test_version.py b/test/test_version.py index 0f5e711c..746e30c8 100644 --- a/test/test_version.py +++ b/test/test_version.py @@ -22,7 +22,7 @@ import pytest # Import from parent directory pmb_src = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/..")) -sys.path.append(pmb_src) +sys.path.insert(0, pmb_src) import pmb.helpers.git import pmb.helpers.logging import pmb.parse.version diff --git a/test/test_version_validate.py b/test/test_version_validate.py index b2323e5e..01ea7f98 100644 --- a/test/test_version_validate.py +++ b/test/test_version_validate.py @@ -20,7 +20,7 @@ import os import sys # Import from parent directory -sys.path.append(os.path.realpath( +sys.path.insert(0, os.path.realpath( os.path.join(os.path.dirname(__file__) + "/.."))) import pmb.parse.version