Skip to content

Commit ca94bda

Browse files
authored
Merge pull request #396 from nicoddemus/fix-4.1.0-tests
Skip config.warn tests in pytest 4.1
2 parents f283ddd + 261d418 commit ca94bda

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

testing/acceptance_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,10 +738,12 @@ def test_ok():
738738
class TestWarnings:
739739
@pytest.mark.parametrize("n", ["-n0", "-n1"])
740740
@pytest.mark.parametrize("warn_type", ["pytest", "builtin"])
741-
def test_warnings(self, testdir, n, warn_type):
741+
def test_warnings(self, testdir, n, request, warn_type):
742742
if warn_type == "builtin":
743743
warn_code = """warnings.warn(UserWarning('this is a warning'))"""
744744
elif warn_type == "pytest":
745+
if not hasattr(request.config, "warn"):
746+
pytest.skip("config.warn has been removed in pytest 4.1")
745747
warn_code = """request.config.warn('', 'this is a warning',
746748
fslocation=py.path.local())"""
747749
else:

0 commit comments

Comments
 (0)