@@ -86,8 +86,7 @@ def test_api_register_schema_invalid(kafka_cluster, load_file):
86
86
schema = Schema (load_file ('invalid_schema.avsc' ), schema_type = 'AVRO' )
87
87
subject = _subject_name ('test_invalid_schema' )
88
88
89
- with pytest .raises (SchemaRegistryError , match = "Input schema is an invalid"
90
- " Avro schema" ) as e :
89
+ with pytest .raises (SchemaRegistryError ) as e :
91
90
sr .register_schema (subject , schema )
92
91
assert e .value .http_status_code == 422
93
92
assert e .value .error_code == 42201
@@ -126,7 +125,7 @@ def test_api_get_schema_not_found(kafka_cluster, load_file):
126
125
"""
127
126
sr = kafka_cluster .schema_registry ()
128
127
129
- with pytest .raises (SchemaRegistryError , match = "Schema not found" ) as e :
128
+ with pytest .raises (SchemaRegistryError , match = "Schema .* not found.* " ) as e :
130
129
sr .get_schema (999999 )
131
130
132
131
assert e .value .http_status_code == 404
@@ -148,7 +147,7 @@ def test_api_get_registration_subject_not_found(kafka_cluster, load_file):
148
147
149
148
subject = _subject_name ("registration_subject_not_found" )
150
149
151
- with pytest .raises (SchemaRegistryError , match = "Subject not found" ) as e :
150
+ with pytest .raises (SchemaRegistryError , match = "Subject .* not found.* " ) as e :
152
151
sr .lookup_schema (subject , schema )
153
152
assert e .value .http_status_code == 404
154
153
assert e .value .error_code == 40401
@@ -265,7 +264,7 @@ def test_api_delete_subject_not_found(kafka_cluster):
265
264
266
265
subject = _subject_name ("test-delete_invalid_subject" )
267
266
268
- with pytest .raises (SchemaRegistryError , match = "Subject not found" ) as e :
267
+ with pytest .raises (SchemaRegistryError , match = "Subject .* not found.* " ) as e :
269
268
sr .delete_subject (subject )
270
269
assert e .value .http_status_code == 404
271
270
assert e .value .error_code == 40401
@@ -302,7 +301,7 @@ def test_api_get_subject_version_no_version(kafka_cluster, load_file):
302
301
subject = _subject_name ('test-get_subject' )
303
302
sr .register_schema (subject , schema )
304
303
305
- with pytest .raises (SchemaRegistryError , match = "Version not found" ) as e :
304
+ with pytest .raises (SchemaRegistryError , match = "Version .* not found" ) as e :
306
305
sr .get_version (subject , version = 3 )
307
306
assert e .value .http_status_code == 404
308
307
assert e .value .error_code == 40402
@@ -316,8 +315,9 @@ def test_api_get_subject_version_invalid(kafka_cluster, load_file):
316
315
subject = _subject_name ('test-get_subject' )
317
316
sr .register_schema (subject , schema )
318
317
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 :
321
321
sr .get_version (subject , version = 'a' )
322
322
assert e .value .http_status_code == 422
323
323
assert e .value .error_code == 42202
0 commit comments