Capture warnings around the entire runtestprotocol

This is necessary for the warnings plugin to play nice with the
recwarn fixture
This commit is contained in:
Bruno Oliveira
2017-03-16 21:54:41 -03:00
parent 0baed781fe
commit be5db6fa22
3 changed files with 10 additions and 24 deletions

View File

@@ -145,7 +145,9 @@ class TestDeprecatedCall(object):
pytest.deprecated_call(deprecated_function)
""")
result = testdir.runpytest()
result.stdout.fnmatch_lines('*=== 2 passed in *===')
# the 2 tests must pass, but the call to test_one() will generate a warning
# in pytest's summary
result.stdout.fnmatch_lines('*=== 2 passed, 1 warnings in *===')
class TestWarns(object):