관리-도구
편집 파일: test_code_segment.cpython-311.pyc
� �܋f� � �Z � d dl mZ d dlmZmZmZmZmZm Z d dl mZ G d� de� � ZdS )� )�messages)� FunctionScope� ClassScope�ModuleScope�Argument�FunctionDefinition� Assignment)�TestCasec �0 � e Zd ZdZd� Zd� Zd� Zd� Zd� ZdS )�TestCodeSegmentsz( Tests for segments of a module c �x � | � dd�� � | � dt j d�� � d S )NzH def foo(): def bar(): pass T�� is_segmentzI def foo(): def bar(): x = 0 ��flakes�m�UnusedVariable��selfs �p/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pyflakes/test/test_code_segment.py�test_function_segmentz&TestCodeSegments.test_function_segment �] � ���� � � � � � � ��� � � �$� � 0� 0� 0� 0� 0� c �x � | � dd�� � | � dt j d�� � d S )NzH class Foo: class Bar: pass Tr zI class Foo: def bar(): x = 0 r r s r �test_class_segmentz#TestCodeSegments.test_class_segment r r c �| � | � dd�� � }|j }d� |D � � }d� |D � � }d� |D � � }| � t |� � d� � | � t |� � d� � | � t |� � d� � |d }|d }| � |t � � | � |t � � | � d |� � | � d |� � | � d|� � | � d|� � | � d |� � | � d|� � | � |d t � � | � |d t � � | � |d t � � | � |d t � � | � |d t � � | � |d t � � d S )Nzi class Foo: x = 0 def bar(a, b=1, *d, **e): pass Tr c �. � g | ]}|j t u �|��S � �� __class__r ��.0�scopes r � <listcomp>z5TestCodeSegments.test_scope_class.<locals>.<listcomp>/ �. � � I� I� I����K�)G�)G�E�)G�)G�)Gr c �. � g | ]}|j t u �|��S r )r r r! s r r$ z5TestCodeSegments.test_scope_class.<locals>.<listcomp>1 s. � � H� H� H����J�)F�)F�E�)F�)F�)Fr c �. � g | ]}|j t u �|��S r �r r r! s r r$ z5TestCodeSegments.test_scope_class.<locals>.<listcomp>3 �. � � K� K� K����M�)I�)I�E�)I�)I�)Ir r � �x�bar�a�b�d�e)r � deadScopes�assertEqual�len�assertIsInstancer r �assertInr r r )r �checker�scopes� module_scopes�class_scopes�function_scopes�class_scope�function_scopes r �test_scope_classz!TestCodeSegments.test_scope_class&