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

@@ -267,7 +267,6 @@ def test_pytest_plugins_in_non_top_level_conftest_deprecated_no_false_positives(
)
# @pytest.mark.skipif(six.PY2, reason="We issue the warning in Python 3 only")
def test_call_fixture_function_deprecated():
"""Check if a warning is raised if a fixture function is called directly (#3661)"""