33from openapi_spec_validator import openapi_v2_spec_validator
44from openapi_spec_validator import openapi_v30_spec_validator
55from openapi_spec_validator import validate_spec
6- from openapi_spec_validator import validate_spec_factory
76from openapi_spec_validator import validate_spec_url
8- from openapi_spec_validator import validate_spec_url_factory
9- from openapi_spec_validator import validate_v2_spec
10- from openapi_spec_validator import validate_v2_spec_url
11- from openapi_spec_validator import validate_v30_spec
12- from openapi_spec_validator import validate_v30_spec_url
137from openapi_spec_validator .validation .exceptions import OpenAPIValidationError
148from openapi_spec_validator .validation .exceptions import ValidatorDetectError
159
@@ -50,9 +44,7 @@ def test_valid(self, factory, spec_file):
5044 spec_url = factory .spec_file_url (spec_path )
5145
5246 validate_spec (spec )
53- validate_v2_spec (spec )
54-
55- validate_spec_factory (openapi_v2_spec_validator )(spec , spec_url )
47+ validate_spec (spec , validator = openapi_v2_spec_validator )
5648
5749 @pytest .mark .parametrize (
5850 "spec_file" ,
@@ -65,7 +57,7 @@ def test_falied(self, factory, spec_file):
6557 spec = factory .spec_from_file (spec_path )
6658
6759 with pytest .raises (OpenAPIValidationError ):
68- validate_v2_spec (spec )
60+ validate_spec (spec , validator = openapi_v2_spec_validator )
6961
7062
7163class TestLocalValidatev30Spec :
@@ -87,9 +79,8 @@ def test_valid(self, factory, spec_file):
8779 spec_url = factory .spec_file_url (spec_path )
8880
8981 validate_spec (spec )
90- validate_v30_spec (spec )
91-
92- validate_spec_factory (openapi_v30_spec_validator )(spec , spec_url )
82+ validate_spec (spec , spec_url = spec_url )
83+ validate_spec (spec , validator = openapi_v30_spec_validator )
9384
9485 @pytest .mark .parametrize (
9586 "spec_file" ,
@@ -102,7 +93,7 @@ def test_falied(self, factory, spec_file):
10293 spec = factory .spec_from_file (spec_path )
10394
10495 with pytest .raises (OpenAPIValidationError ):
105- validate_v30_spec (spec )
96+ validate_spec (spec , validator = openapi_v30_spec_validator )
10697
10798
10899@pytest .mark .network
@@ -130,9 +121,7 @@ def test_valid(self, spec_file):
130121 spec_url = self .remote_test_suite_file_path (spec_file )
131122
132123 validate_spec_url (spec_url )
133- validate_v2_spec_url (spec_url )
134-
135- validate_spec_url_factory (openapi_v2_spec_validator )(spec_url )
124+ validate_spec_url (spec_url , validator = openapi_v2_spec_validator )
136125
137126
138127@pytest .mark .network
@@ -160,6 +149,4 @@ def test_valid(self, spec_file):
160149 spec_url = self .remote_test_suite_file_path (spec_file )
161150
162151 validate_spec_url (spec_url )
163- validate_v30_spec_url (spec_url )
164-
165- validate_spec_url_factory (openapi_v30_spec_validator )(spec_url )
152+ validate_spec_url (spec_url , validator = openapi_v30_spec_validator )
0 commit comments