Remove YIELD_TESTS from deprecated module as it is now an error

This commit is contained in:
Bruno Oliveira 2019-06-30 12:28:40 -03:00
parent aa1955de72
commit 7b35405033
2 changed files with 3 additions and 4 deletions

View File

@ -10,8 +10,6 @@ in case of warnings which need to format their messages.
""" """
from _pytest.warning_types import PytestDeprecationWarning 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 # set of plugins which have been integrated into the core; we use this list to ignore
# them during registration to avoid conflicts # them during registration to avoid conflicts
DEPRECATED_EXTERNAL_PLUGINS = { DEPRECATED_EXTERNAL_PLUGINS = {

View File

@ -12,7 +12,6 @@ from textwrap import dedent
import py import py
import _pytest import _pytest
from _pytest import deprecated
from _pytest import fixtures from _pytest import fixtures
from _pytest import nodes from _pytest import nodes
from _pytest._code import filter_traceback from _pytest._code import filter_traceback
@ -218,7 +217,9 @@ def pytest_pycollect_makeitem(collector, name, obj):
elif getattr(obj, "__test__", True): elif getattr(obj, "__test__", True):
if is_generator(obj): if is_generator(obj):
res = Function(name, parent=collector) 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.add_marker(MARK_GEN.xfail(run=False, reason=reason))
res.warn(PytestCollectionWarning(reason)) res.warn(PytestCollectionWarning(reason))
else: else: