I guess you could use `with self.assertRaises(...):` here, possibly would make this slightly nicer.