some minor internal cleanup

This commit is contained in:
holger krekel
2013-12-09 10:40:39 +01:00
parent bdf9147ad4
commit 5c3d692008
2 changed files with 6 additions and 7 deletions

View File

@@ -1661,15 +1661,15 @@ class FixtureManager:
yieldctx=marker.yieldctx,
unittest=unittest)
faclist = self._arg2fixturedefs.setdefault(name, [])
if not fixturedef.has_location:
# All fixturedefs with no location are at the front
if fixturedef.has_location:
faclist.append(fixturedef)
else:
# fixturedefs with no location are at the front
# so this inserts the current fixturedef after the
# existing fixturedefs from external plugins but
# before the fixturedefs provided in conftests.
i = len([f for f in faclist if not f.has_location])
else:
i = len(faclist) # append
faclist.insert(i, fixturedef)
faclist.insert(i, fixturedef)
if marker.autouse:
autousenames.append(name)
if autousenames: