Added warns to assert warnings are thrown

Works in a similar manner to `raises`, but for warnings instead
of exceptions. Also refactored `recwarn.py` so that all the
warning recording and checking use the same core code.
This commit is contained in:
Eric Hunsberger
2015-07-28 19:01:11 -04:00
parent aac371cf07
commit 52b4eb6c46
7 changed files with 394 additions and 139 deletions

View File

@@ -34,7 +34,6 @@ class TestRaises:
raise BuiltinAssertionError
""")
@pytest.mark.skipif('sys.version < "2.5"')
def test_raises_as_contextmanager(self, testdir):
testdir.makepyfile("""
from __future__ import with_statement