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 · 0 comments

Comments

Projects
None yet
2 participants
@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

Merge pull request #2776 from cryporchild/fix-missing-nodeid-with-pyargs
Fix #2775 - running pytest with "--pyargs" will result in Items with …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment