diff --git a/samples/openapi3/client/petstore/python/tests/test_deserialization.py b/samples/openapi3/client/petstore/python/tests/test_deserialization.py index 8db2929be354..c8ae1a90c77d 100644 --- a/samples/openapi3/client/petstore/python/tests/test_deserialization.py +++ b/samples/openapi3/client/petstore/python/tests/test_deserialization.py @@ -297,7 +297,12 @@ def test_deserialize_animal(self): json_str = '{"className": "Cat", "color": "red", "declawed": true}' deserialized = petstore_api.Animal.from_json(json_str) - self.assertTrue(isinstance(deserialized, petstore_api.Cat)) + + # the following is necessary for mypy as it does not handle isinstance() within self.assertTrue() well + if not isinstance(deserialized, petstore_api.Cat): + self.assertTrue(False) + return + self.assertEqual(deserialized.class_name, "Cat") self.assertEqual(deserialized.declawed, True) self.assertEqual(deserialized.to_json(), '{"className": "Cat", "color": "red", "declawed": true}')