← Back
Editing: test_deprecations.cpython-312.pyc
� �% gJ; � � � d dl mZ d dlmZ d dlmZmZ d dlZd dl Z d dl Z d dlZd dlZ d dlZd dlmZmZmZmZ G d� de� Zy)� )�contextmanager)�BytesIO)�TestCase�mockN)� FormatChecker� exceptions� protocols� validatorsc � � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zd � Zd� Z d� Zd � Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zy)�TestDeprecationsc � � d}| j t |� 5 }ddlm} ddd� | j t j j d� � | j j t � y# 1 sw Y �YxY w)zY As of v4.0.0, __version__ is deprecated in favor of importlib.metadata. z.Accessing jsonschema.__version__ is deprecatedr )�__version__N� jsonschema) �assertWarnsRegex�DeprecationWarningr r �assertEqual� importlib�metadata�version�filename�__file__)�self�message�wr s �G/usr/lib/python3.12/site-packages/jsonschema/tests/test_deprecations.py�test_versionzTestDeprecations.test_version sg � � C�� � "� "�#5�w� ?�1�.� @� ����i�&8�&8�&@�&@��&N�O�������X�.� @� ?�s �A8�8Bc �� � d}| j t |� 5 }ddlm} ddd� | j t j � | j j t � y# 1 sw Y �JxY w)z� As of v4.0.0, importing ErrorTree from jsonschema.validators is deprecated in favor of doing so from jsonschema.exceptions. z2Importing ErrorTree from jsonschema.validators is r �� ErrorTreeN)r r �jsonschema.validatorsr r r r r �r r r r s r �test_validators_ErrorTreez*TestDeprecations.test_validators_ErrorTree s\ � � G�� � "� "�#5�w� ?�1�7� @� ����J�$8�$8�9�������X�.� @� ?�� �A)�)A2c �� � d}| j t |� 5 }ddlm} ddd� | j t j � | j j t � y# 1 sw Y �JxY w)z� As of v4.18.0, importing ErrorTree from the package root is deprecated in favor of doing so from jsonschema.exceptions. z9Importing ErrorTree directly from the jsonschema package r r N)r r r r r r r r r! s r �test_import_ErrorTreez&TestDeprecations.test_import_ErrorTree) s\ � � N�� � "� "�#5�w� ?�1�,� @� ����J�$8�$8�9�������X�.� @� ?�r# c �� � d}| j t |� 5 }ddlm} ddd� | j t j � | j j t � y# 1 sw Y �JxY w)z� As of v4.18.0, importing FormatError from the package root is deprecated in favor of doing so from jsonschema.exceptions. z;Importing FormatError directly from the jsonschema package r )�FormatErrorN)r r r r'