Merge pull request #4991 from blueyed/fix-tests

Fix pytest's own tests with `-W error::ResourceWarning`
This commit is contained in:
Bruno Oliveira 2019-03-25 20:47:51 -03:00 committed by GitHub
commit bcdb86ee7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -1103,6 +1103,7 @@ class TestFixtureUsages(object):
values = reprec.getfailedcollections()
assert len(values) == 1
@pytest.mark.filterwarnings("ignore::pytest.PytestDeprecationWarning")
def test_request_can_be_overridden(self, testdir):
testdir.makepyfile(
"""

View File

@ -116,7 +116,8 @@ class SessionTests(object):
class TestBrokenClass(object):
def test_explicit_bad_repr(self):
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):
t = BrokenRepr1()