What you wrote would *almost* work, but you'd need to do:
```
assert_equal(len(w), 1)
assert_true(w[0].category == DeprecationWarning)
```
(you tried to access `w.category`, but `w` is a list)