don't call nose' setup methods if they are marked with pytest.setup

This commit is contained in:
holger krekel
2012-09-22 00:23:36 +02:00
parent 738f14a48a
commit 465cfff6f9
4 changed files with 14 additions and 3 deletions

View File

@@ -24,6 +24,17 @@ def test_nose_setup(testdir):
])
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