def test_qrcode_bad_factory(self): self.assertRaises( TypeError, qrcode.QRCode, image_factory='not_BaseImage') self.assertRaises( AssertionError, qrcode.QRCode, image_factory=dict)