streamline some hook docs and option handling, remove cruft bits, fix doc links

This commit is contained in:
holger krekel
2010-10-31 23:28:31 +01:00
parent 14b2b128c2
commit 5616874823
11 changed files with 47 additions and 54 deletions

View File

@@ -46,13 +46,13 @@ def pytest_configure(config):
def pytest_cmdline_main(config):
return Session(config).main()
def pytest_perform_collection(session):
def pytest_collection_perform(session):
collection = session.collection
assert not hasattr(collection, 'items')
hook = session.config.hook
collection.items = items = collection.perform_collect()
hook.pytest_collection_modifyitems(config=session.config, items=items)
hook.pytest_log_finishcollection(collection=collection)
hook.pytest_collection_finish(collection=collection)
return True
def pytest_runtest_mainloop(session):
@@ -128,7 +128,7 @@ class Session(object):
try:
config.pluginmanager.do_configure(config)
config.hook.pytest_sessionstart(session=self)
config.hook.pytest_perform_collection(session=self)
config.hook.pytest_collection_perform(session=self)
config.hook.pytest_runtest_mainloop(session=self)
except pytest.UsageError:
raise
@@ -261,7 +261,7 @@ class Collection:
def genitems(self, node):
if isinstance(node, pytest.collect.Item):
node.ihook.pytest_log_itemcollect(item=node)
node.ihook.pytest_itemcollected(item=node)
yield node
else:
assert isinstance(node, pytest.collect.Collector)