1 new commit in pytest:

https://bitbucket.org/hpk42/pytest/changeset/5083259b34c8/
changeset:   5083259b34c8
user:        hpk42
date:        2012-09-22 00:23:36
summary:     don't call nose' setup methods if they are marked with pytest.setup
affected #:  4 files

diff -r fb7a0c24f6908799dc0bde25b41326ebc56e1f36 -r 
5083259b34c8ac69d12243d73451d2e2f3a720ab _pytest/__init__.py
--- a/_pytest/__init__.py
+++ b/_pytest/__init__.py
@@ -1,2 +1,2 @@
 #
-__version__ = '2.3.0.dev15'
+__version__ = '2.3.0.dev16'


diff -r fb7a0c24f6908799dc0bde25b41326ebc56e1f36 -r 
5083259b34c8ac69d12243d73451d2e2f3a720ab _pytest/nose.py
--- a/_pytest/nose.py
+++ b/_pytest/nose.py
@@ -41,7 +41,7 @@
 
 def call_optional(obj, name):
     method = getattr(obj, name, None)
-    if method:
+    if method is not None and not hasattr(method, "_pytestsetup"):
         # If there's any problems allow the exception to raise rather than
         # silently ignoring them
         method()


diff -r fb7a0c24f6908799dc0bde25b41326ebc56e1f36 -r 
5083259b34c8ac69d12243d73451d2e2f3a720ab 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.3.0.dev15',
+        version='2.3.0.dev16',
         url='http://pytest.org',
         license='MIT license',
         platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],


diff -r fb7a0c24f6908799dc0bde25b41326ebc56e1f36 -r 
5083259b34c8ac69d12243d73451d2e2f3a720ab testing/test_nose.py
--- a/testing/test_nose.py
+++ b/testing/test_nose.py
@@ -24,6 +24,17 @@
     ])
 
 
+def test_setup_func_with_setup_decorator():
+    from _pytest.nose import call_optional
+    l = []
+    class A:
+        @pytest.setup()
+        def f(self):
+            l.append(1)
+    call_optional(A(), "f")
+    assert not l
+
+
 def test_nose_setup_func(testdir):
     p = testdir.makepyfile("""
         from nose.tools import with_setup

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