55
66class BaseTestValidOpeAPIv3Validator (object ):
77
8- def test_valid (self , validator , spec ):
9- return validator .validate (spec )
8+ @pytest .fixture
9+ def spec_url (self ):
10+ return ''
11+
12+ def test_valid (self , validator , spec , spec_url ):
13+ return validator .validate (spec , spec_url = spec_url )
1014
1115
1216class BaseTestFailedOpeAPIv3Validator (object ):
1317
14- def test_failed (self , validator , spec ):
18+ @pytest .fixture
19+ def spec_url (self ):
20+ return ''
21+
22+ def test_failed (self , validator , spec , spec_url ):
1523 with pytest .raises (ValidationError ):
16- validator .validate (spec )
24+ validator .validate (spec , spec_url = spec_url )
1725
1826
1927class TestLocalEmptyExample (BaseTestFailedOpeAPIv3Validator ):
@@ -30,6 +38,19 @@ def spec(self, factory):
3038 return factory .spec_from_file ("data/v3.0/petstore.yaml" )
3139
3240
41+ class TestLocalPetstoreSeparateExample (BaseTestValidOpeAPIv3Validator ):
42+
43+ spec_file = "data/v3.0/petstore-separate/spec/openapi.yaml"
44+
45+ @pytest .fixture
46+ def spec_url (self , factory ):
47+ return factory .spec_url (self .spec_file )
48+
49+ @pytest .fixture
50+ def spec (self , factory ):
51+ return factory .spec_from_file (self .spec_file )
52+
53+
3354class TestPetstoreExample (BaseTestValidOpeAPIv3Validator ):
3455
3556 @pytest .fixture
0 commit comments