would be better to use `assert_raises` or `self.assertRaises` here to be consistent with other modules.