@@ -12,6 +12,7 @@ def test_version(self):
1212 with self .assertWarns (DeprecationWarning ) as w :
1313 from jsonschema import __version__ # noqa
1414
15+ self .assertEqual (w .filename , __file__ )
1516 self .assertTrue (
1617 str (w .warning ).startswith (
1718 "Accessing jsonschema.__version__ is deprecated" ,
@@ -27,6 +28,7 @@ def test_validators_ErrorTree(self):
2728 with self .assertWarns (DeprecationWarning ) as w :
2829 from jsonschema .validators import ErrorTree # noqa
2930
31+ self .assertEqual (w .filename , __file__ )
3032 self .assertTrue (
3133 str (w .warning ).startswith (
3234 "Importing ErrorTree from jsonschema.validators is deprecated" ,
@@ -43,6 +45,7 @@ def test_validators_validators(self):
4345 value = validators .validators
4446 self .assertEqual (value , validators ._VALIDATORS )
4547
48+ self .assertEqual (w .filename , __file__ )
4649 self .assertTrue (
4750 str (w .warning ).startswith (
4851 "Accessing jsonschema.validators.validators is deprecated" ,
@@ -59,6 +62,7 @@ def test_validators_meta_schemas(self):
5962 value = validators .meta_schemas
6063 self .assertEqual (value , validators ._META_SCHEMAS )
6164
65+ self .assertEqual (w .filename , __file__ )
6266 self .assertTrue (
6367 str (w .warning ).startswith (
6468 "Accessing jsonschema.validators.meta_schemas is deprecated" ,
@@ -75,6 +79,7 @@ def test_RefResolver_in_scope(self):
7579 with resolver .in_scope ("foo" ):
7680 pass
7781
82+ self .assertEqual (w .filename , __file__ )
7883 self .assertTrue (
7984 str (w .warning ).startswith (
8085 "jsonschema.RefResolver.in_scope is deprecated " ,
@@ -92,6 +97,7 @@ def test_Validator_is_valid_two_arguments(self):
9297 result = validator .is_valid ("foo" , {"type" : "number" })
9398
9499 self .assertFalse (result )
100+ self .assertEqual (w .filename , __file__ )
95101 self .assertTrue (
96102 str (w .warning ).startswith (
97103 "Passing a schema to Validator.is_valid is deprecated " ,
@@ -109,6 +115,7 @@ def test_Validator_iter_errors_two_arguments(self):
109115 error , = validator .iter_errors ("foo" , {"type" : "number" })
110116
111117 self .assertEqual (error .validator , "type" )
118+ self .assertEqual (w .filename , __file__ )
112119 self .assertTrue (
113120 str (w .warning ).startswith (
114121 "Passing a schema to Validator.iter_errors is deprecated " ,
0 commit comments