3
3
from openapi_spec_validator import openapi_v2_spec_validator
4
4
from openapi_spec_validator import openapi_v30_spec_validator
5
5
from openapi_spec_validator import validate_spec
6
- from openapi_spec_validator import validate_spec_factory
7
6
from 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
13
7
from openapi_spec_validator .validation .exceptions import OpenAPIValidationError
14
8
from openapi_spec_validator .validation .exceptions import ValidatorDetectError
15
9
@@ -50,9 +44,7 @@ def test_valid(self, factory, spec_file):
50
44
spec_url = factory .spec_file_url (spec_path )
51
45
52
46
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 )
56
48
57
49
@pytest .mark .parametrize (
58
50
"spec_file" ,
@@ -65,7 +57,7 @@ def test_falied(self, factory, spec_file):
65
57
spec = factory .spec_from_file (spec_path )
66
58
67
59
with pytest .raises (OpenAPIValidationError ):
68
- validate_v2_spec (spec )
60
+ validate_spec (spec , validator = openapi_v2_spec_validator )
69
61
70
62
71
63
class TestLocalValidatev30Spec :
@@ -87,9 +79,8 @@ def test_valid(self, factory, spec_file):
87
79
spec_url = factory .spec_file_url (spec_path )
88
80
89
81
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 )
93
84
94
85
@pytest .mark .parametrize (
95
86
"spec_file" ,
@@ -102,7 +93,7 @@ def test_falied(self, factory, spec_file):
102
93
spec = factory .spec_from_file (spec_path )
103
94
104
95
with pytest .raises (OpenAPIValidationError ):
105
- validate_v30_spec (spec )
96
+ validate_spec (spec , validator = openapi_v30_spec_validator )
106
97
107
98
108
99
@pytest .mark .network
@@ -130,9 +121,7 @@ def test_valid(self, spec_file):
130
121
spec_url = self .remote_test_suite_file_path (spec_file )
131
122
132
123
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 )
136
125
137
126
138
127
@pytest .mark .network
@@ -160,6 +149,4 @@ def test_valid(self, spec_file):
160
149
spec_url = self .remote_test_suite_file_path (spec_file )
161
150
162
151
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