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)