fix reporting for @mock'd test functions

This commit is contained in:
holger krekel
2013-12-03 11:23:22 +01:00
parent 5dbf4fc0c2
commit d30ad3f5ce
3 changed files with 7 additions and 2 deletions

View File

@@ -133,6 +133,10 @@ class TestMockDecoration:
""")
reprec = testdir.inline_run()
reprec.assertoutcome(passed=2)
calls = reprec.getcalls("pytest_runtest_logreport")
funcnames = [call.report.location[2] for call in calls
if call.report.when == "call"]
assert funcnames == ["T.test_hello", "test_someting"]
def test_mock_sorting(self, testdir):
pytest.importorskip("mock", "1.0.1")