Remove explicit kwargs handling from raises, warns and ParameterSet.param
This commit is contained in:
@@ -2,7 +2,6 @@ import os
|
||||
|
||||
import pytest
|
||||
from _pytest import deprecated
|
||||
from _pytest.warning_types import PytestDeprecationWarning
|
||||
from _pytest.warnings import SHOW_PYTEST_WARNINGS_ARG
|
||||
|
||||
pytestmark = pytest.mark.pytester_example_path("deprecated")
|
||||
@@ -199,11 +198,3 @@ def test_fixture_named_request(testdir):
|
||||
"*'request' is a reserved name for fixtures and will raise an error in future versions"
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
def test_pytest_warns_unknown_kwargs():
|
||||
with pytest.warns(
|
||||
PytestDeprecationWarning,
|
||||
match=r"pytest.warns\(\) got unexpected keyword arguments: \['foo'\]",
|
||||
):
|
||||
pytest.warns(UserWarning, foo="hello")
|
||||
|
||||
@@ -8,7 +8,6 @@ from _pytest.mark import EMPTY_PARAMETERSET_OPTION
|
||||
from _pytest.mark import MarkGenerator as Mark
|
||||
from _pytest.nodes import Collector
|
||||
from _pytest.nodes import Node
|
||||
from _pytest.warning_types import PytestDeprecationWarning
|
||||
from _pytest.warnings import SHOW_PYTEST_WARNINGS_ARG
|
||||
|
||||
ignore_markinfo = pytest.mark.filterwarnings(
|
||||
@@ -1004,15 +1003,3 @@ def test_pytest_param_id_requires_string():
|
||||
@pytest.mark.parametrize("s", (None, "hello world"))
|
||||
def test_pytest_param_id_allows_none_or_string(s):
|
||||
assert pytest.param(id=s)
|
||||
|
||||
|
||||
def test_pytest_param_warning_on_unknown_kwargs():
|
||||
with pytest.warns(PytestDeprecationWarning) as warninfo:
|
||||
# typo, should be marks=
|
||||
pytest.param(1, 2, mark=pytest.mark.xfail())
|
||||
assert warninfo[0].filename == __file__
|
||||
msg, = warninfo[0].message.args
|
||||
assert msg == (
|
||||
"pytest.param() got unexpected keyword arguments: ['mark'].\n"
|
||||
"This will be an error in future versions."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user