Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why the arguments are changed? #1095

Closed
Huarong opened this issue Dec 3, 2018 · 2 comments
Closed

why the arguments are changed? #1095

Huarong opened this issue Dec 3, 2018 · 2 comments

Comments

@Huarong
Copy link

@Huarong Huarong commented Dec 3, 2018

When using the posargs, the path in the argument is changed with no reason. Why ?

tox.ini

[tox]
envlist=py27,py36
skipsdist=True

[testenv]
deps = pytest
commands=pytest -s tests {posargs}

image

@asottile
Copy link
Member

@asottile asottile commented Dec 8, 2018

hmmm wow yeah there appears to be something seriously wrong here.

Here's another fun one:

[tox]
skipsdist = True

[testenv]
changedir=../
commands =
    python -c 'import sys; print(sys.argv[1:])' {posargs}
$ tox -e py36 -- $PWD/tox.ini
py36 runtests: PYTHONHASHSEED='659093790'
py36 runtests: commands[0] | python -c 'import sys; print(sys.argv[1:])' x/tox.ini
['x/tox.ini']
___________________________________ summary ____________________________________
  py36: commands succeeded
  congratulations :)

it appears to be attempting to normalize paths to account for changedir -- but doing so incorrectly.

Thanks for the report! 🎉

@asottile
Copy link
Member

@asottile asottile commented Dec 8, 2018

There's this relevant bit from the docs indicating the adjustment is intentional, at least for relative paths:

tox rewrites each positional argument if it is a relative
path and exists on the filesystem to become a path relative to the
changedir setting.

@helpr helpr bot added the pr-available label Dec 8, 2018
@helpr helpr bot added pr-merged and removed pr-available labels Dec 8, 2018
@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants