From 61965d59a87ffc7ab368eae6c79bf7b40510fd6d Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Sun, 26 Feb 2017 06:26:33 -0800 Subject: [PATCH] Remove setup_syspath entirely It's vestigial remains from the early days of pyelftools which was originally developed on Windows, running the tests through an editor rather than on the command line. Not setting the run path in the code is safer - it's more reliable to control where the code is found outside the code itself now --- test/run_examples_test.py | 1 - test/run_readelf_tests.py | 1 - test/utils.py | 11 ----------- 3 files changed, 13 deletions(-) diff --git a/test/run_examples_test.py b/test/run_examples_test.py index 2fd3ad1..9bec604 100755 --- a/test/run_examples_test.py +++ b/test/run_examples_test.py @@ -9,7 +9,6 @@ #------------------------------------------------------------------------------- import os, sys import logging -from utils import setup_syspath; setup_syspath() from utils import run_exe, is_in_rootdir, dump_output_to_temp_files diff --git a/test/run_readelf_tests.py b/test/run_readelf_tests.py index f8990e1..9f5a4f7 100755 --- a/test/run_readelf_tests.py +++ b/test/run_readelf_tests.py @@ -13,7 +13,6 @@ from difflib import SequenceMatcher from optparse import OptionParser import logging import platform -from utils import setup_syspath; setup_syspath() from utils import run_exe, is_in_rootdir, dump_output_to_temp_files diff --git a/test/utils.py b/test/utils.py index 0425f45..7f89685 100644 --- a/test/utils.py +++ b/test/utils.py @@ -9,16 +9,6 @@ from __future__ import print_function import os, sys, subprocess, tempfile -# This module should not import elftools before setup_syspath() is called! -# See the Hacking Guide in the documentation for more details. - -def setup_syspath(): - """ Setup sys.path so that tests pick up local pyelftools before the - installed one when run from development directory. - """ - if sys.path[0] != '.': - sys.path.insert(0, '.') - def run_exe(exe_path, args=[], echo=False): """ Runs the given executable as a subprocess, given the @@ -54,4 +44,3 @@ def dump_output_to_temp_files(testlog, *args): file.write(s) file.close() testlog.info('@@ Output #%s dumped to file: %s' % (i + 1, path)) - -- 2.30.2