Make sure warn is called in test_parameterset_extractfrom

This commit is contained in:
Bruno Oliveira 2018-09-05 09:01:29 -03:00
parent f42b5019ec
commit ddb308455a
1 changed files with 7 additions and 2 deletions

View File

@ -1039,14 +1039,19 @@ class TestKeywordSelection(object):
), ),
], ],
) )
@pytest.mark.filterwarnings("ignore") @pytest.mark.filterwarnings("default")
def test_parameterset_extractfrom(argval, expected): def test_parameterset_extractfrom(argval, expected):
from _pytest.deprecated import MARK_PARAMETERSET_UNPACKING
warn_called = []
class DummyItem: class DummyItem:
def warn(self, warning): def warn(self, warning):
pass warn_called.append(warning)
extracted = ParameterSet.extract_from(argval, belonging_definition=DummyItem()) extracted = ParameterSet.extract_from(argval, belonging_definition=DummyItem())
assert extracted == expected assert extracted == expected
assert warn_called == [MARK_PARAMETERSET_UNPACKING]
def test_legacy_transfer(): def test_legacy_transfer():