File tree Expand file tree Collapse file tree 1 file changed +7
-21
lines changed Expand file tree Collapse file tree 1 file changed +7
-21
lines changed Original file line number Diff line number Diff line change 22from __future__ import unicode_literals
33
44import sys
5+ import warnings
56
67import six
78
@@ -685,25 +686,10 @@ def test_false_function_no_warn(self, testdir):
685686 result .stdout .fnmatch_lines (["*1 failed in*" ])
686687
687688
688- def test_warningschecker_twice ( testdir ):
689+ def test_warnings_checker_twice ( ):
689690 """Issue #4617"""
690-
691- testdir .makepyfile (
692- """
693- import pytest
694- import warnings
695-
696- @pytest.mark.parametrize("other", [1, 2])
697- @pytest.mark.parametrize("expectation", [
698- pytest.warns(DeprecationWarning,
699- match="Message A"),
700- pytest.warns(DeprecationWarning,
701- match="Message A"),
702- ])
703- def test_parametrized_warnings(other, expectation):
704- with expectation:
705- warnings.warn("Message A", DeprecationWarning)
706- """
707- )
708- result = testdir .runpytest ()
709- result .stdout .fnmatch_lines (["* 4 passed in *" ])
691+ expectation = pytest .warns (UserWarning )
692+ with expectation :
693+ warnings .warn ("Message A" , UserWarning )
694+ with expectation :
695+ warnings .warn ("Message B" , UserWarning )
You can’t perform that action at this time.
0 commit comments