Skip to content

Commit d93b967

Browse files
committed
Re-add the second test for importing jsonschema.cli
(This doesn't functionally change anything, but does resolve some warnings module frustration thanks to @asottile and @gaborbernat.)
1 parent 7448523 commit d93b967

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

jsonschema/tests/test_deprecations.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from unittest import TestCase
2+
import importlib
23
import subprocess
34
import sys
45

@@ -264,6 +265,22 @@ def test_draftN_format_checker(self):
264265
with self.assertRaises(ImportError):
265266
from jsonschema import draft1234_format_checker # noqa
266267

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+
267284
def test_cli(self):
268285
"""
269286
As of v4.17.0, the jsonschema CLI is deprecated.

0 commit comments

Comments
 (0)