Remove YIELD_TESTS from deprecated module as it is now an error
This commit is contained in:
parent
aa1955de72
commit
7b35405033
|
@ -10,8 +10,6 @@ in case of warnings which need to format their messages.
|
|||
"""
|
||||
from _pytest.warning_types import PytestDeprecationWarning
|
||||
|
||||
YIELD_TESTS = "yield tests were removed in pytest 4.0 - {name} will be ignored"
|
||||
|
||||
# set of plugins which have been integrated into the core; we use this list to ignore
|
||||
# them during registration to avoid conflicts
|
||||
DEPRECATED_EXTERNAL_PLUGINS = {
|
||||
|
|
|
@ -12,7 +12,6 @@ from textwrap import dedent
|
|||
import py
|
||||
|
||||
import _pytest
|
||||
from _pytest import deprecated
|
||||
from _pytest import fixtures
|
||||
from _pytest import nodes
|
||||
from _pytest._code import filter_traceback
|
||||
|
@ -218,7 +217,9 @@ def pytest_pycollect_makeitem(collector, name, obj):
|
|||
elif getattr(obj, "__test__", True):
|
||||
if is_generator(obj):
|
||||
res = Function(name, parent=collector)
|
||||
reason = deprecated.YIELD_TESTS.format(name=name)
|
||||
reason = "yield tests were removed in pytest 4.0 - {name} will be ignored".format(
|
||||
name=name
|
||||
)
|
||||
res.add_marker(MARK_GEN.xfail(run=False, reason=reason))
|
||||
res.warn(PytestCollectionWarning(reason))
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue