What to change?
All occurences of
- assertRaises
- assertRaisesRegex
- assertWarns
- assertWarnsRegex
They can be found here.
Why to change?
These unittest methods were changed from partial call to context manager with the benefit of better readability and a new msg parameter which is provided with it
How to change?
replace code like
self.assertRaisesRegex(ValueError, "invalid literal for.*XYZ'$", int, 'XYZ')
with
with self.assertRaisesRegex(ValueError, "invalid literal for.*XYZ'$"): int('XYZ')