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 2
2
from __future__ import unicode_literals
3
3
4
4
import sys
5
+ import warnings
5
6
6
7
import six
7
8
@@ -685,25 +686,10 @@ def test_false_function_no_warn(self, testdir):
685
686
result .stdout .fnmatch_lines (["*1 failed in*" ])
686
687
687
688
688
- def test_warningschecker_twice ( testdir ):
689
+ def test_warnings_checker_twice ( ):
689
690
"""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