Skip to content

Commit

Permalink
chore: remove deprecation warning getting jsonschema's version (canon…
Browse files Browse the repository at this point in the history
…ical#5856)

DeprecationWarning: Accessing jsonschema.__version__ is deprecated and will
be removed in a future release. Use importlib.metadata directly to query
for jsonschema's version.

canonicalGH-5174
  • Loading branch information
aciba90 authored and mathmarchand committed Nov 21, 2024
1 parent 1f49e16 commit ed2713e
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 ed2713e

Please sign in to comment.