Use assertRaises and add a specific warning filter.
1 file changed