def test_get_collector_trail_and_back(self): |
a = self.tmpdir.ensure("a", dir=1) |
self.tmpdir.ensure("a", "__init__.py") |
x = self.tmpdir.ensure("a", "trail.py") |
config = py.test.config._reparse([x]) |
col = config._getcollector(x) |
-> trail = config.get_collector_trail(col) |
assert len(trail) == 2 |
assert trail[0] == a.relto(config.topdir) |
assert trail[1] == ('trail.py',) |
col2 = config._getcollector(trail) |
assert col2.listnames() == col.listnames() |