관리-도구
편집 파일: config.cpython-311.pyc
� �܋f � �l � d dl Z dZdadadadZdadadadZ d� Z d� Zd� Zd� Z G d� de� � Zd� ZdS ) � Nc �$ � t j | i |��S )a� Deliver multiple versions of a test based on positional combinations. This is a facade over pytest.mark.parametrize. :param \*comb: argument combinations. These are tuples that will be passed positionally to the decorated function. :param argnames: optional list of argument names. These are the names of the arguments in the test function that correspond to the entries in each argument tuple. pytest.mark.parametrize requires this, however the combinations function will derive it automatically if not present by using ``inspect.getfullargspec(fn).args[1:]``. Note this assumes the first argument is "self" which is discarded. :param id\_: optional id template. This is a string template that describes how the "id" for each parameter set should be defined, if any. The number of characters in the template should match the number of entries in each argument tuple. Each character describes how the corresponding entry in the argument tuple should be handled, as far as whether or not it is included in the arguments passed to the function, as well as if it is included in the tokens used to create the id of the parameter set. If omitted, the argument combinations are passed to parametrize as is. If passed, each argument combination is turned into a pytest.param() object, mapping the elements of the argument tuple to produce an id based on a character value in the same position within the string template using the following scheme:: i - the given argument is a string that is part of the id only, don't pass it as an argument n - the given argument should be passed and it should be added to the id by calling the .__name__ attribute r - the given argument should be passed and it should be added to the id by calling repr() s - the given argument should be passed and it should be added to the id by calling str() a - (argument) the given argument should be passed and it should not be used to generated the id e.g.:: @testing.combinations( (operator.eq, "eq"), (operator.ne, "ne"), (operator.gt, "gt"), (operator.lt, "lt"), id_="na" ) def test_operator(self, opfunc, name): pass The above combination will call ``.__name__`` on the first member of each tuple and use that as the "id" to pytest.param(). )�_fixture_functions�combinations)�comb�kws �l/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/sqlalchemy/testing/config.pyr r s � �~ �*�D�7�B�7�7�7� c � � t | i |��S )z+As combination, but takes a single iterable)r )�arg_iterabler s r �combinations_listr X s � ���,��,�,�,r c �$ � t j | i |��S �N)r �fixture)�argr s r r r ] s � ��%�s�1�b�1�1�1r c �4 � t � � � S r )r �get_current_test_name� r r r r a s � ��3�3�5�5�5r c �� � e Zd Zd� Z ej � � Z e� � Zd� Z e d� � � Ze d� � � Ze d� � � Z e d� � � Ze d� � � Ze d� � � Ze d � � � Zd � ZdS )�Configc � � | � |� � || _ || _ || _ || _ d| _ d| _ d S )N�test_schema� test_schema_2)� _set_name�db�db_opts�options�file_configr r )�selfr r r r s r �__init__zConfig.__init__f sG � ����r�������������&���(���,����r c �� � |j j rEd� d� |j j D � � � � }|j �d|j �d|�d�| _ d S |j �d|j ��| _ d S )N�.c 3 �4 K � | ]}t |� � V � �d S r )�str)�.0�toks r � <genexpr>z#Config._set_name.<locals>.<genexpr>t s( � � � �N�N��3�s�8�8�N�N�N�N�N�Nr �+z_[�])�dialect�server_version_info�join�name�driver)r r �svis r r zConfig._set_namer sp � � �:�)� 7��(�(�N�N�r�z�/M�N�N�N�N�N�C�(*��������C�C�C�@�D�I�I�I�#%�7�7�7�B�I�I�6�D�I�I�Ir c �^ � t ||||� � }| j � |� � |S )z�add a config as one of the global configs. If there are no configs set up yet, this config also gets set as the "_current". )r �_configs�add)�clsr r r r �cfgs r �registerzConfig.registery s2 � � �R��'�;�7�7����������� r c �h � |a |j j a|j a|j a|j a|j x|_ ad S r )�_currentr �url�db_urlr r r �r2 �config� namespaces r �set_as_currentzConfig.set_as_current� s; � � �������.���(���,� �"�I�%� ��r�r�rr c � � t s J d� � �| � t |t j t j t j � � |� � d S )Nz*Can't push without a default Config set up)r6 �pushr r r r )r2 r r; s r �push_enginezConfig.push_engine� sZ � ��E�E�E�E�E�x������H�$�h�&6��8L� � � � � � � � r c �p � | j � t � � | � ||� � d S r )�_stack�appendr6 r<