관리-도구
편집 파일: context.cpython-311.pyc
� �܋f� � �R � d Z ddlmZ ddlmZ ddlmZmZmZm Z dd �Z dd �Zdd�ZdS )z"Determine contexts for coverage.py� )�annotations)� FrameType)�cast�Callable�Optional�Sequence�context_switchers�.Sequence[Callable[[FrameType], Optional[str]]]�return�.Optional[Callable[[FrameType], Optional[str]]]c �R � � � sdS t � � � dk r� d S d � fd�}|S ) a Create a single context switcher from multiple switchers. `context_switchers` is a list of functions that take a frame as an argument and return a string to use as the new context label. Returns a function that composites `context_switchers` functions, or None if `context_switchers` is an empty list. When invoked, the combined switcher calls `context_switchers` one-by-one until a string is returned. The combined switcher returns None if all `context_switchers` return None. N� r �framer r � Optional[str]c �4 �� �D ]} || � � }|�|c S �dS )z,The combiner for multiple context switchers.N� )r �switcher�new_contextr s ��c/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/coverage/context.py�should_start_contextz7combine_context_switchers.<locals>.should_start_context! s; �� �)� #� #�H�"�(�5�/�/�K��&�"�"�"�"� '��t� �r r r r )�len)r r s ` r �combine_context_switchersr sW �� � � ��t� �����"�"� ��#�#�� � � � � � �r r r r c �r � | j j }|� d� � s|dk rt | � � S dS )z(Is this frame calling a test_* function?�test�runTestN)�f_code�co_name� startswith�qualname_from_frame)r r s r �"should_start_context_test_functionr"