some minor internal cleanup
This commit is contained in:
parent
bdf9147ad4
commit
5c3d692008
|
@ -16,8 +16,7 @@ def main(args=None, plugins=None):
|
||||||
initialization.
|
initialization.
|
||||||
"""
|
"""
|
||||||
config = _prepareconfig(args, plugins)
|
config = _prepareconfig(args, plugins)
|
||||||
exitstatus = config.hook.pytest_cmdline_main(config=config)
|
return config.hook.pytest_cmdline_main(config=config)
|
||||||
return exitstatus
|
|
||||||
|
|
||||||
class cmdline: # compatibility namespace
|
class cmdline: # compatibility namespace
|
||||||
main = staticmethod(main)
|
main = staticmethod(main)
|
||||||
|
|
|
@ -1661,15 +1661,15 @@ class FixtureManager:
|
||||||
yieldctx=marker.yieldctx,
|
yieldctx=marker.yieldctx,
|
||||||
unittest=unittest)
|
unittest=unittest)
|
||||||
faclist = self._arg2fixturedefs.setdefault(name, [])
|
faclist = self._arg2fixturedefs.setdefault(name, [])
|
||||||
if not fixturedef.has_location:
|
if fixturedef.has_location:
|
||||||
# All fixturedefs with no location are at the front
|
faclist.append(fixturedef)
|
||||||
|
else:
|
||||||
|
# fixturedefs with no location are at the front
|
||||||
# so this inserts the current fixturedef after the
|
# so this inserts the current fixturedef after the
|
||||||
# existing fixturedefs from external plugins but
|
# existing fixturedefs from external plugins but
|
||||||
# before the fixturedefs provided in conftests.
|
# before the fixturedefs provided in conftests.
|
||||||
i = len([f for f in faclist if not f.has_location])
|
i = len([f for f in faclist if not f.has_location])
|
||||||
else:
|
faclist.insert(i, fixturedef)
|
||||||
i = len(faclist) # append
|
|
||||||
faclist.insert(i, fixturedef)
|
|
||||||
if marker.autouse:
|
if marker.autouse:
|
||||||
autousenames.append(name)
|
autousenames.append(name)
|
||||||
if autousenames:
|
if autousenames:
|
||||||
|
|
Loading…
Reference in New Issue