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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user