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

Fix #2775 - running pytest with "--pyargs" will result in Items with … #2776

Merged
merged 3 commits into from Nov 12, 2017

Conversation

cboelsen
Copy link

…empty "parent.nodeid" if run from a different root directory

…tems with empty "parent.nodeid" if run from a different root directory
@nicoddemus
Copy link
Member

xref: #2775

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks just wrong

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's a fair comment. I've updated this to (hopefully) use the py.path apis properly.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 794d458 on cryporchild:fix-missing-nodeid-with-pyargs into ** on pytest-dev:master**.

@nicoddemus
Copy link
Member

@cryporchild gentle ping.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 92.258% when pulling f0f2d2b on cryporchild:fix-missing-nodeid-with-pyargs into b671c5a on pytest-dev:master.

@nicoddemus
Copy link
Member

Thanks @cryporchild, and sorry for this taking so long! 👍

@nicoddemus nicoddemus merged commit 259b86b into pytest-dev:master Nov 12, 2017
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants