Fix pytest's own tests with `-W error::ResourceWarning`
This commit is contained in:
parent
b3319a6074
commit
3127ec737b
|
@ -1103,6 +1103,7 @@ class TestFixtureUsages(object):
|
||||||
values = reprec.getfailedcollections()
|
values = reprec.getfailedcollections()
|
||||||
assert len(values) == 1
|
assert len(values) == 1
|
||||||
|
|
||||||
|
@pytest.mark.filterwarnings("ignore::pytest.PytestDeprecationWarning")
|
||||||
def test_request_can_be_overridden(self, testdir):
|
def test_request_can_be_overridden(self, testdir):
|
||||||
testdir.makepyfile(
|
testdir.makepyfile(
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -116,7 +116,8 @@ class SessionTests(object):
|
||||||
class TestBrokenClass(object):
|
class TestBrokenClass(object):
|
||||||
def test_explicit_bad_repr(self):
|
def test_explicit_bad_repr(self):
|
||||||
t = BrokenRepr1()
|
t = BrokenRepr1()
|
||||||
pytest.raises(Exception, 'repr(t)')
|
with pytest.raises(Exception, match="I'm a broken repr"):
|
||||||
|
repr(t)
|
||||||
|
|
||||||
def test_implicit_bad_repr1(self):
|
def test_implicit_bad_repr1(self):
|
||||||
t = BrokenRepr1()
|
t = BrokenRepr1()
|
||||||
|
|
Loading…
Reference in New Issue