Skip to content

Commit

Permalink
chore: remove deprecation warning getting jsonschema's version (#5856)
Browse files Browse the repository at this point in the history
DeprecationWarning: Accessing jsonschema.__version__ is deprecated and will
be removed in a future release. Use importlib.metadata directly to query
for jsonschema's version.

GH-5174
  • Loading branch information
aciba90 committed Nov 13, 2024
1 parent 5950099 commit 7f9a34f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/unittests/config/test_cc_ubuntu_pro.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This file is part of cloud-init. See LICENSE file for license information.
import importlib.metadata
import json
import logging
import re
Expand Down Expand Up @@ -447,13 +448,10 @@ class TestUbuntuProSchema:
" Use **ubuntu_pro** instead"
),
),
# If __version__ no longer exists on jsonschema, that means
# we're using a high enough version of jsonschema to not need
# to skip this test.
(
JSONSCHEMA_SKIP_REASON
if lifecycle.Version.from_str(
getattr(jsonschema, "__version__", "999")
importlib.metadata.version("jsonschema")
)
< lifecycle.Version(4)
else ""
Expand Down

0 comments on commit 7f9a34f

Please sign in to comment.