As with the changes to test_load.py, this (and the other instances of this idiom in this file) would be better handled with the self.assertRaises context manager.