[py-svn] commit/pytest: hpk42: remove a hack that isn't needed because runtestprotocol now memorizes pending teardowns and thus dist-testing has "exact" teardowns as well

Bitbucket commits-noreply at bitbucket.org
Fri Nov 18 17:59:07 CET 2011


1 new commit in pytest:


https://bitbucket.org/hpk42/pytest/changeset/c7127c5e5ee3/
changeset:   c7127c5e5ee3
user:        hpk42
date:        2011-11-18 17:58:21
summary:     remove a hack that isn't needed because runtestprotocol now memorizes pending teardowns and thus dist-testing has "exact" teardowns as well
affected #:  4 files

diff -r 16af87f5ea632158d618774caa93efc71879daee -r c7127c5e5ee38d8ecb7683f5b4dd5ff44c107154 _pytest/__init__.py
--- a/_pytest/__init__.py
+++ b/_pytest/__init__.py
@@ -1,2 +1,2 @@
 #
-__version__ = '2.2.0.dev9'
+__version__ = '2.2.0.dev10'


diff -r 16af87f5ea632158d618774caa93efc71879daee -r c7127c5e5ee38d8ecb7683f5b4dd5ff44c107154 _pytest/main.py
--- a/_pytest/main.py
+++ b/_pytest/main.py
@@ -330,6 +330,8 @@
     """ a basic test invocation item. Note that for a single function
     there might be multiple test invocation items.
     """
+    nextitem = None
+
     def reportinfo(self):
         return self.fspath, None, ""
 


diff -r 16af87f5ea632158d618774caa93efc71879daee -r c7127c5e5ee38d8ecb7683f5b4dd5ff44c107154 _pytest/runner.py
--- a/_pytest/runner.py
+++ b/_pytest/runner.py
@@ -340,13 +340,7 @@
         assert not self._finalizers
 
     def teardown_exact(self, item):
-        try:
-            colitem = item.nextitem
-        except AttributeError:
-            # in distributed testing there might be no known nexitem
-            # and in this case we use the parent node to at least call
-            # teardown of the current item
-            colitem = item.parent
+        colitem = item.nextitem
         needed_collectors = colitem and colitem.listchain() or []
         self._teardown_towards(needed_collectors)
 


diff -r 16af87f5ea632158d618774caa93efc71879daee -r c7127c5e5ee38d8ecb7683f5b4dd5ff44c107154 setup.py
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@
         name='pytest',
         description='py.test: simple powerful testing with Python',
         long_description = long_description,
-        version='2.2.0.dev9',
+        version='2.2.0.dev10',
         url='http://pytest.org',
         license='MIT license',
         platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],

Repository URL: https://bitbucket.org/hpk42/pytest/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the pytest-commit mailing list