fix issue616 - conftest visibility fixes. This is achieved by

refactoring how nodeid's are constructed.  They now are always
relative to the "common rootdir" of a test run which is determined by
finding a common ancestor of all testrun arguments.

--HG--
branch : issue616
This commit is contained in:
holger krekel
2015-02-26 21:56:44 +01:00
parent aa757f7715
commit d73e689991
13 changed files with 329 additions and 81 deletions

View File

@@ -1653,11 +1653,9 @@ class FixtureManager:
# what fixtures are visible for particular tests (as denoted
# by their test id)
if p.basename.startswith("conftest.py"):
nodeid = self.session.fspath.bestrelpath(p.dirpath())
nodeid = p.dirpath().relto(self.config.rootdir)
if p.sep != "/":
nodeid = nodeid.replace(p.sep, "/")
if nodeid == ".":
nodeid = ""
self.parsefactories(plugin, nodeid)
self._seenplugins.add(plugin)