@@ -86,8 +86,7 @@ def test_api_register_schema_invalid(kafka_cluster, load_file):
8686 schema = Schema (load_file ('invalid_schema.avsc' ), schema_type = 'AVRO' )
8787 subject = _subject_name ('test_invalid_schema' )
8888
89- with pytest .raises (SchemaRegistryError , match = "Input schema is an invalid"
90- " Avro schema" ) as e :
89+ with pytest .raises (SchemaRegistryError ) as e :
9190 sr .register_schema (subject , schema )
9291 assert e .value .http_status_code == 422
9392 assert e .value .error_code == 42201
@@ -126,7 +125,7 @@ def test_api_get_schema_not_found(kafka_cluster, load_file):
126125 """
127126 sr = kafka_cluster .schema_registry ()
128127
129- with pytest .raises (SchemaRegistryError , match = "Schema not found" ) as e :
128+ with pytest .raises (SchemaRegistryError , match = "Schema .* not found.* " ) as e :
130129 sr .get_schema (999999 )
131130
132131 assert e .value .http_status_code == 404
@@ -148,7 +147,7 @@ def test_api_get_registration_subject_not_found(kafka_cluster, load_file):
148147
149148 subject = _subject_name ("registration_subject_not_found" )
150149
151- with pytest .raises (SchemaRegistryError , match = "Subject not found" ) as e :
150+ with pytest .raises (SchemaRegistryError , match = "Subject .* not found.* " ) as e :
152151 sr .lookup_schema (subject , schema )
153152 assert e .value .http_status_code == 404
154153 assert e .value .error_code == 40401
@@ -265,7 +264,7 @@ def test_api_delete_subject_not_found(kafka_cluster):
265264
266265 subject = _subject_name ("test-delete_invalid_subject" )
267266
268- with pytest .raises (SchemaRegistryError , match = "Subject not found" ) as e :
267+ with pytest .raises (SchemaRegistryError , match = "Subject .* not found.* " ) as e :
269268 sr .delete_subject (subject )
270269 assert e .value .http_status_code == 404
271270 assert e .value .error_code == 40401
@@ -302,7 +301,7 @@ def test_api_get_subject_version_no_version(kafka_cluster, load_file):
302301 subject = _subject_name ('test-get_subject' )
303302 sr .register_schema (subject , schema )
304303
305- with pytest .raises (SchemaRegistryError , match = "Version not found" ) as e :
304+ with pytest .raises (SchemaRegistryError , match = "Version .* not found" ) as e :
306305 sr .get_version (subject , version = 3 )
307306 assert e .value .http_status_code == 404
308307 assert e .value .error_code == 40402
@@ -316,8 +315,9 @@ def test_api_get_subject_version_invalid(kafka_cluster, load_file):
316315 subject = _subject_name ('test-get_subject' )
317316 sr .register_schema (subject , schema )
318317
319- with pytest .raises (SchemaRegistryError , match = "The specified version is not"
320- " a valid version id" ) as e :
318+ with pytest .raises (SchemaRegistryError ,
319+ match = "The specified version .*is not"
320+ " a valid version id.*" ) as e :
321321 sr .get_version (subject , version = 'a' )
322322 assert e .value .http_status_code == 422
323323 assert e .value .error_code == 42202
0 commit comments