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
+2 -2
View File
@@ -21,7 +21,7 @@ class SessionTests:
assert failed[0].nodenames[-1] == "test_one_one"
assert failed[1].nodenames[-1] == "test_other"
assert failed[2].nodenames[-1] == "test_two"
itemstarted = reprec.getcalls("pytest_log_itemcollect")
itemstarted = reprec.getcalls("pytest_itemcollected")
assert len(itemstarted) == 4
colstarted = reprec.getcalls("pytest_collectstart")
assert len(colstarted) == 1 + 1 # XXX ExtraTopCollector
@@ -181,7 +181,7 @@ class TestNewSession(SessionTests):
)
reprec = testdir.inline_run('--collectonly', p.dirpath())
itemstarted = reprec.getcalls("pytest_log_itemcollect")
itemstarted = reprec.getcalls("pytest_itemcollected")
assert len(itemstarted) == 3
assert not reprec.getreports("pytest_runtest_logreport")
started = reprec.getcalls("pytest_collectstart")
+10 -11
View File
@@ -176,7 +176,7 @@ class TestCollectonly:
"<Module 'test_collectonly_basic.py'>"
])
item = modcol.collect()[0]
rep.config.hook.pytest_log_itemcollect(item=item)
rep.config.hook.pytest_itemcollected(item=item)
linecomp.assert_contains_lines([
" <Function 'test_func'>",
])
@@ -456,24 +456,23 @@ def test_fail_reporting_on_pass(testdir):
assert 'short test summary' not in result.stdout.str()
def test_getreportopt():
testdict = {}
class Config:
def getvalue(self, name):
return testdict.get(name, None)
config = Config()
testdict.update(dict(report="xfailed"))
class config:
class option:
reportchars = ""
config.option.report = "xfailed"
assert getreportopt(config) == "x"
testdict.update(dict(report="xfailed,skipped"))
config.option.report = "xfailed,skipped"
assert getreportopt(config) == "xs"
testdict.update(dict(report="skipped,xfailed"))
config.option.report = "skipped,xfailed"
assert getreportopt(config) == "sx"
testdict.update(dict(report="skipped", reportchars="sf"))
config.option.report = "skipped"
config.option.reportchars = "sf"
assert getreportopt(config) == "sf"
testdict.update(dict(reportchars="sfx"))
config.option.reportchars = "sfx"
assert getreportopt(config) == "sfx"
def test_terminalreporter_reportopt_addargs(testdir):