@@ -12,6 +12,7 @@ def test_version(self):
12
12
with self .assertWarns (DeprecationWarning ) as w :
13
13
from jsonschema import __version__ # noqa
14
14
15
+ self .assertEqual (w .filename , __file__ )
15
16
self .assertTrue (
16
17
str (w .warning ).startswith (
17
18
"Accessing jsonschema.__version__ is deprecated" ,
@@ -27,6 +28,7 @@ def test_validators_ErrorTree(self):
27
28
with self .assertWarns (DeprecationWarning ) as w :
28
29
from jsonschema .validators import ErrorTree # noqa
29
30
31
+ self .assertEqual (w .filename , __file__ )
30
32
self .assertTrue (
31
33
str (w .warning ).startswith (
32
34
"Importing ErrorTree from jsonschema.validators is deprecated" ,
@@ -43,6 +45,7 @@ def test_validators_validators(self):
43
45
value = validators .validators
44
46
self .assertEqual (value , validators ._VALIDATORS )
45
47
48
+ self .assertEqual (w .filename , __file__ )
46
49
self .assertTrue (
47
50
str (w .warning ).startswith (
48
51
"Accessing jsonschema.validators.validators is deprecated" ,
@@ -59,6 +62,7 @@ def test_validators_meta_schemas(self):
59
62
value = validators .meta_schemas
60
63
self .assertEqual (value , validators ._META_SCHEMAS )
61
64
65
+ self .assertEqual (w .filename , __file__ )
62
66
self .assertTrue (
63
67
str (w .warning ).startswith (
64
68
"Accessing jsonschema.validators.meta_schemas is deprecated" ,
@@ -75,6 +79,7 @@ def test_RefResolver_in_scope(self):
75
79
with resolver .in_scope ("foo" ):
76
80
pass
77
81
82
+ self .assertEqual (w .filename , __file__ )
78
83
self .assertTrue (
79
84
str (w .warning ).startswith (
80
85
"jsonschema.RefResolver.in_scope is deprecated " ,
@@ -92,6 +97,7 @@ def test_Validator_is_valid_two_arguments(self):
92
97
result = validator .is_valid ("foo" , {"type" : "number" })
93
98
94
99
self .assertFalse (result )
100
+ self .assertEqual (w .filename , __file__ )
95
101
self .assertTrue (
96
102
str (w .warning ).startswith (
97
103
"Passing a schema to Validator.is_valid is deprecated " ,
@@ -109,6 +115,7 @@ def test_Validator_iter_errors_two_arguments(self):
109
115
error , = validator .iter_errors ("foo" , {"type" : "number" })
110
116
111
117
self .assertEqual (error .validator , "type" )
118
+ self .assertEqual (w .filename , __file__ )
112
119
self .assertTrue (
113
120
str (w .warning ).startswith (
114
121
"Passing a schema to Validator.iter_errors is deprecated " ,
0 commit comments