1 new changeset in pytest:

http://bitbucket.org/hpk42/pytest/changeset/afadd1bcdd7a/
changeset:   afadd1bcdd7a
user:        hpk42
date:        2011-07-05 21:23:59
summary:     fix issue53: nose-style setup now called with the correct ordering
affected #:  5 files (467 bytes)

--- a/CHANGELOG Tue Jul 05 19:14:38 2011 +0200
+++ b/CHANGELOG Tue Jul 05 21:23:59 2011 +0200
@@ -1,6 +1,7 @@
 Changes between 2.0.3 and 2.1.0.DEV
 ----------------------------------------------
 
+- fix issue53 call nosestyle setup functions with correct ordering
 - fix issue58 and issue59: new assertion code fixes
 - merge Benjamin's assertionrewrite branch: now assertions
   for test modules on python 2.6 and above are done by rewriting


--- a/_pytest/__init__.py       Tue Jul 05 19:14:38 2011 +0200
+++ b/_pytest/__init__.py       Tue Jul 05 21:23:59 2011 +0200
@@ -1,2 +1,2 @@
 #
-__version__ = '2.1.0.dev8'
+__version__ = '2.1.0.dev9'


--- a/_pytest/nose.py   Tue Jul 05 19:14:38 2011 +0200
+++ b/_pytest/nose.py   Tue Jul 05 21:23:59 2011 +0200
@@ -13,6 +13,7 @@
             call.excinfo = call2.excinfo
 
 
+@pytest.mark.trylast
 def pytest_runtest_setup(item):
     if isinstance(item, (pytest.Function)):
         if isinstance(item.parent, pytest.Generator):


--- a/setup.py  Tue Jul 05 19:14:38 2011 +0200
+++ b/setup.py  Tue Jul 05 21:23:59 2011 +0200
@@ -22,7 +22,7 @@
         name='pytest',
         description='py.test: simple powerful testing with Python',
         long_description = long_description,
-        version='2.1.0.dev8',
+        version='2.1.0.dev9',
         url='http://pytest.org',
         license='MIT license',
         platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],


--- a/testing/test_nose.py      Tue Jul 05 19:14:38 2011 +0200
+++ b/testing/test_nose.py      Tue Jul 05 21:23:59 2011 +0200
@@ -255,3 +255,19 @@
     result.stdout.fnmatch_lines([
         "*2 passed*",
     ])
+
+def test_nose_setup_ordering(testdir):
+    testdir.makepyfile("""
+        def setup_module(mod):
+            mod.visited = True
+
+        class TestClass:
+            def setup(self):
+                assert visited
+            def test_first(self):
+                pass
+        """)
+    result = testdir.runpytest()
+    result.stdout.fnmatch_lines([
+        "*1 passed*",
+    ])

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.
_______________________________________________
py-svn mailing list
py-svn@codespeak.net
http://codespeak.net/mailman/listinfo/py-svn

Reply via email to