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

Running pytest with "--pyargs" will result in Items with empty "parent.nodeid" if run from a different root directory #2775

Closed
cboelsen opened this issue Sep 13, 2017 · 1 comment
Labels

Comments

@cboelsen
Copy link

@cboelsen cboelsen commented Sep 13, 2017

When running pytest with "--pyargs" from a directory that isn't a parent directory of the packages under test, then the Items created will have an empty parent.nodeid (i.e. "::test_function").

This is because the _makeid() method in FSCollector compares the path of the Module to the rootdir:

relpath = self.fspath.relto(self.config.rootdir)
nicoddemus added a commit that referenced this issue Nov 12, 2017
Fix #2775 - running pytest with "--pyargs" will result in Items with …
@blueyed
Copy link
Contributor

@blueyed blueyed commented Feb 10, 2020

I think comparing it / making it relative to the rootdir is what is expected, but it should make it relative always (see #6701 for a followup).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.