More explicitly: `assert_warns` creates a new warnings context (`catch_warnings(record=True)`) internally, and sets `simplefilter('always')` to avoid a Python bug if for no other reason, and matches the expected warning class against the list of recorded warnings as the context is `__exit__`ed.