From 8307270cec5980fd2469bb216142a6c566b6be49 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Fri, 2 Dec 2011 21:00:21 +0000 Subject: [PATCH] yay! now that we have perfect teardowns we don't need some ugly internal hooks anymore. --- _pytest/__init__.py | 2 +- _pytest/hookspec.py | 8 -------- _pytest/runner.py | 7 ------- _pytest/terminal.py | 3 --- setup.py | 2 +- testing/test_capture.py | 2 +- 6 files changed, 3 insertions(+), 21 deletions(-) diff --git a/_pytest/__init__.py b/_pytest/__init__.py index 33f303f5e..767fe51ef 100644 --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.2.1.dev1' +__version__ = '2.2.1.dev2' diff --git a/_pytest/hookspec.py b/_pytest/hookspec.py index ce128c744..b05e33421 100644 --- a/_pytest/hookspec.py +++ b/_pytest/hookspec.py @@ -165,14 +165,6 @@ def pytest_runtest_logreport(report): """ process a test setup/call/teardown report relating to the respective phase of executing a test. """ -# special handling for final teardown - somewhat internal for now -def pytest__teardown_final(session): - """ called before test session finishes. """ -pytest__teardown_final.firstresult = True - -def pytest__teardown_final_logerror(report, session): - """ called if runtest_teardown_final failed. """ - # ------------------------------------------------------------------------- # test session related hooks # ------------------------------------------------------------------------- diff --git a/_pytest/runner.py b/_pytest/runner.py index 2ed278647..12d3a5375 100644 --- a/_pytest/runner.py +++ b/_pytest/runner.py @@ -48,13 +48,6 @@ def pytest_terminal_summary(terminalreporter): def pytest_sessionstart(session): session._setupstate = SetupState() -def pytest_sessionfinish(session, exitstatus): - hook = session.config.hook - rep = hook.pytest__teardown_final(session=session) - if rep: - hook.pytest__teardown_final_logerror(session=session, report=rep) - session.exitstatus = 1 - class NodeInfo: def __init__(self, location): self.location = location diff --git a/_pytest/terminal.py b/_pytest/terminal.py index 76b91b138..5245f339b 100644 --- a/_pytest/terminal.py +++ b/_pytest/terminal.py @@ -161,9 +161,6 @@ class TerminalReporter: def pytest_deselected(self, items): self.stats.setdefault('deselected', []).extend(items) - def pytest__teardown_final_logerror(self, report): - self.stats.setdefault("error", []).append(report) - def pytest_runtest_logstart(self, nodeid, location): # ensure that the path is printed before the # 1st test of a module starts running diff --git a/setup.py b/setup.py index ddc5d1df2..d0be8894b 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ def main(): name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.2.1.dev1', + version='2.2.1.dev2', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff --git a/testing/test_capture.py b/testing/test_capture.py index b5c1744c9..2cfd013a9 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -205,7 +205,7 @@ class TestPerTestCapturing: #"*1 fixture failure*" ]) - def test_teardown_final_capturing(self, testdir): + def test_teardown_capturing_final(self, testdir): p = testdir.makepyfile(""" def teardown_module(mod): print ("teardown module")