Refactor direct fixture call warning to avoid incompatibility with plugins

This refactors the code so we have the real function object right during
collection. This avoids having to unwrap it later and lose attached information
such as "async" functions.

Fix #3747
This commit is contained in:
Bruno Oliveira
2018-07-31 22:09:19 -03:00
parent 253419316c
commit c6b11b9f62
5 changed files with 32 additions and 19 deletions

View File

@@ -1470,10 +1470,9 @@ class TestFixtureManagerParseFactories(object):
print (faclist)
assert len(faclist) == 3
kwargs = {'__being_called_by_pytest': True}
assert faclist[0].func(item._request, **kwargs) == "conftest"
assert faclist[1].func(item._request, **kwargs) == "module"
assert faclist[2].func(item._request, **kwargs) == "class"
assert faclist[0].func(item._request) == "conftest"
assert faclist[1].func(item._request) == "module"
assert faclist[2].func(item._request) == "class"
"""
)
reprec = testdir.inline_run("-s")