Fix #2775 - running pytest with "--pyargs" will result in Items with …#2776
Merged
nicoddemus merged 3 commits intopytest-dev:masterfrom Nov 12, 2017
Merged
Conversation
…tems with empty "parent.nodeid" if run from a different root directory
Member
|
xref: #2775 |
RonnyPfannschmidt
requested changes
Sep 28, 2017
Member
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
The function discovering the path completely missuses the py.path apis
_pytest/main.py
Outdated
| def _check_initialpaths_for_relpath(self): | ||
| for initialpath in self.session._initialpaths: | ||
| parent_path = self.fspath | ||
| for _ in parent_path.parts(): |
Member
There was a problem hiding this comment.
This looks just wrong
Author
There was a problem hiding this comment.
Yep, that's a fair comment. I've updated this to (hopefully) use the py.path apis properly.
|
Changes Unknown when pulling 794d458 on cryporchild:fix-missing-nodeid-with-pyargs into ** on pytest-dev:master**. |
Member
|
@cryporchild gentle ping. |
RonnyPfannschmidt
approved these changes
Nov 11, 2017
Member
|
Thanks @cryporchild, and sorry for this taking so long! 👍 |
3 tasks
blueyed
added a commit
to blueyed/pytest
that referenced
this pull request
Feb 10, 2020
This is relevant for `pytest t/foo.py --rootdir=/tmp`. Before: ``` ../../../../tmp F.sxx … t/foo.py:5: ValueError … FAILED ../../../../tmp/::test_fail - ValueError ``` This removes `_check_initialpaths_for_relpath` (added via pytest-dev#2776 to address part of the issue), but it is apparently bad trying to make them relative to any given arg, when they are meant to be relative to `rootdir` really.
blueyed
added a commit
to blueyed/pytest
that referenced
this pull request
Feb 24, 2020
This is relevant for `pytest t/foo.py --rootdir=/tmp`. Before: ``` ../../../../tmp F.sxx … t/foo.py:5: ValueError … FAILED ../../../../tmp/::test_fail - ValueError ``` This removes `_check_initialpaths_for_relpath` (added via pytest-dev#2776 to address part of the issue), but it is apparently bad trying to make them relative to any given arg, when they are meant to be relative to `rootdir` really.
blueyed
added a commit
to blueyed/pytest
that referenced
this pull request
Feb 24, 2020
This is relevant for `pytest t/foo.py --rootdir=/tmp`. Before: ``` ../../../../tmp F.sxx … t/foo.py:5: ValueError … FAILED ../../../../tmp/::test_fail - ValueError ``` This removes `_check_initialpaths_for_relpath` (added via pytest-dev#2776 to address part of the issue), but it is apparently bad trying to make them relative to any given arg, when they are meant to be relative to `rootdir` really.
blueyed
added a commit
to blueyed/pytest
that referenced
this pull request
Feb 24, 2020
This is relevant for `pytest t/foo.py --rootdir=/tmp`. Before: ``` ../../../../tmp F.sxx … t/foo.py:5: ValueError … FAILED ../../../../tmp/::test_fail - ValueError ``` This removes `_check_initialpaths_for_relpath` (added via pytest-dev#2776 to address part of the issue), but it is apparently bad trying to make them relative to any given arg, when they are meant to be relative to `rootdir` really.
blueyed
added a commit
to blueyed/pytest
that referenced
this pull request
Feb 24, 2020
This is relevant for `pytest t/foo.py --rootdir=/tmp`. Before: ``` ../../../../tmp F.sxx … t/foo.py:5: ValueError … FAILED ../../../../tmp/::test_fail - ValueError ``` This removes `_check_initialpaths_for_relpath` (added via pytest-dev#2776 to address part of the issue), but it is apparently bad trying to make them relative to any given arg, when they are meant to be relative to `rootdir` really.
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.
…empty "parent.nodeid" if run from a different root directory