1. michilu
  2. pytest

Commits

holger krekel  committed ff737e5

yay! now that we have perfect teardowns we don't need some ugly internal hooks anymore.

  • Participants
  • Parent commits e4b9018
  • Branches default

Comments (0)

Files changed (6)

File _pytest/__init__.py

View file
 #
-__version__ = '2.2.1.dev1'
+__version__ = '2.2.1.dev2'

File _pytest/hookspec.py

View file
     """ 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
 # -------------------------------------------------------------------------

File _pytest/runner.py

View file
 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

File _pytest/terminal.py

View file
     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

File setup.py

View file
         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'],

File testing/test_capture.py

View file
             #"*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")