Allow tests declared as @staticmethod to use fixtures

Fix #2699
This commit is contained in:
Bruno Oliveira
2017-08-17 20:37:51 -03:00
parent 5c0c1977e3
commit a993add783
5 changed files with 24 additions and 8 deletions

View File

@@ -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):