File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1
1
from unittest import TestCase
2
+ import importlib
2
3
import subprocess
3
4
import sys
4
5
@@ -264,6 +265,22 @@ def test_draftN_format_checker(self):
264
265
with self .assertRaises (ImportError ):
265
266
from jsonschema import draft1234_format_checker # noqa
266
267
268
+ def test_import_cli (self ):
269
+ """
270
+ As of v4.17.0, importing jsonschema.cli is deprecated.
271
+ """
272
+
273
+ with self .assertWarns (DeprecationWarning ) as w :
274
+ import jsonschema .cli
275
+ importlib .reload (jsonschema .cli )
276
+
277
+ self .assertEqual (w .filename , importlib .__file__ )
278
+ self .assertTrue (
279
+ str (w .warning ).startswith (
280
+ "The jsonschema CLI is deprecated and will be removed " ,
281
+ ),
282
+ )
283
+
267
284
def test_cli (self ):
268
285
"""
269
286
As of v4.17.0, the jsonschema CLI is deprecated.
You can’t perform that action at this time.
0 commit comments