Repository navigation
test_scripts: run scripts from the active interpreter instead of PATH - #2168
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
test/test_scripts.pylooked uppythonand thecan_*console scripts onPATH. If the test interpreter's environment is not onPATH, the commands are not found or run a different installation.-mcommands now start withsys.executable.shutil.which(name, path=sysconfig.get_path("scripts")). This also findsC:\PythonXY\Scripts\on a non-venv Windows install and adds the.exesuffix, soshell=IS_WINDOWSandcommand.split()are no longer needed.from .config import *is removed becauseIS_WINDOWSwas its only use.Related Issues / Pull Requests
Type of Change
Checklist
tox).Additional Notes
Documentation and news fragment are not applicable: the change is test-only and not user-facing.
Reproduction, using only the test environment's interpreter without the venv on
PATH:env -i HOME=$HOME PATH=/usr/bin:/bin .tox/py/bin/python -m pytest test/test_scripts.pymain: 4 of 8 tests fail. Everytest_do_commands_existfails withFileNotFoundError: [Errno 2] No such file or directory: 'python'.FileNotFoundError: console script 'can_bridge' is not installed.