remove pytest_report_iteminfo hook, i strongly guess nobody needs or uses it.

This commit is contained in:
holger krekel
2010-11-04 23:21:23 +01:00
parent 28d51e26a0
commit 5251653fc3
8 changed files with 21 additions and 56 deletions

View File

@@ -1061,18 +1061,6 @@ class TestReportInfo:
nodeinfo = runner.getitemnodeinfo(item)
assert nodeinfo.location == ("ABCDE", 42, "custom")
def test_itemreport_pytest_report_iteminfo(self, testdir, linecomp):
item = testdir.getitem("def test_func(): pass")
tup = "FGHJ", 42, "custom"
class Plugin:
def pytest_report_iteminfo(self, item):
return tup
item.config.pluginmanager.register(Plugin())
runner = runner = item.config.pluginmanager.getplugin("runner")
nodeinfo = runner.getitemnodeinfo(item)
location = nodeinfo.location
assert location == tup
def test_func_reportinfo(self, testdir):
item = testdir.getitem("def test_func(): pass")
fspath, lineno, modpath = item.reportinfo()

View File

@@ -1,5 +1,4 @@
import py
from pytest.plugin.session import pytest_report_iteminfo
class SessionTests:
def test_basic_testitem_events(self, testdir):
@@ -225,12 +224,3 @@ def test_exclude(testdir):
result = testdir.runpytest("--ignore=hello", "--ignore=hello2")
assert result.ret == 0
result.stdout.fnmatch_lines(["*1 passed*"])
def test_pytest_report_iteminfo():
class FakeItem(object):
def reportinfo(self):
return "-reportinfo-"
res = pytest_report_iteminfo(FakeItem())
assert res == "-reportinfo-"

View File

@@ -96,7 +96,7 @@ class TestTerminal:
tr = TerminalReporter(item.config, file=linecomp.stringio)
item.config.pluginmanager.register(tr)
nodeid = item.collection.getid(item)
location = item.ihook.pytest_report_iteminfo(item=item)
location = item.reportinfo()
tr.config.hook.pytest_runtest_logstart(nodeid=nodeid,
location=location, fspath=str(item.fspath))
linecomp.assert_contains_lines([