Merge branch 'master' into features
This commit is contained in:
@@ -147,11 +147,21 @@ class TestClass(object):
|
||||
])
|
||||
|
||||
def test_static_method(self, testdir):
|
||||
"""Support for collecting staticmethod tests (#2528, #2699)"""
|
||||
testdir.getmodulecol("""
|
||||
import pytest
|
||||
class Test(object):
|
||||
@staticmethod
|
||||
def test_something():
|
||||
pass
|
||||
|
||||
@pytest.fixture
|
||||
def fix(self):
|
||||
return 1
|
||||
|
||||
@staticmethod
|
||||
def test_fix(fix):
|
||||
assert fix == 1
|
||||
""")
|
||||
result = testdir.runpytest()
|
||||
if sys.version_info < (2, 7):
|
||||
@@ -162,8 +172,8 @@ class TestClass(object):
|
||||
])
|
||||
else:
|
||||
result.stdout.fnmatch_lines([
|
||||
"*collected 1 item*",
|
||||
"*1 passed in*",
|
||||
"*collected 2 items*",
|
||||
"*2 passed in*",
|
||||
])
|
||||
|
||||
def test_setup_teardown_class_as_classmethod(self, testdir):
|
||||
|
||||
@@ -29,10 +29,16 @@ def test_getfuncargnames():
|
||||
def f(self, arg1, arg2="hello"):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def static(arg1, arg2):
|
||||
pass
|
||||
|
||||
assert fixtures.getfuncargnames(A().f) == ('arg1',)
|
||||
if sys.version_info < (3, 0):
|
||||
assert fixtures.getfuncargnames(A.f) == ('arg1',)
|
||||
|
||||
assert fixtures.getfuncargnames(A.static, cls=A) == ('arg1', 'arg2')
|
||||
|
||||
|
||||
class TestFillFixtures(object):
|
||||
def test_fillfuncargs_exposed(self):
|
||||
|
||||
Reference in New Issue
Block a user