PyTest - Writing Assertions
What will be the result of this pytest code snippet?
import warnings
import pytest
def func():
warnings.warn('Deprecated feature', DeprecationWarning)
def test_func():
with pytest.warns(DeprecationWarning) as record:
func()
assert len(record) == 1
assert record[0].message.args[0] == 'Deprecated feature'