관리-도구
편집 파일: lint_module_output_update.cpython-311.pyc
� �܋f_ � �~ � d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm Z d dl mZmZ d dl mZ G d� d e� � ZdS ) � )�annotationsN)�Config)� PY38_PLUS)�FunctionalTestFile)�LintModuleTest�MessageCounter)� OutputLinec �x � � e Zd ZdZ G d� dej � � Z ej de� � dd� fd� Zdd�Z � xZ S )�LintModuleOutputUpdatezXClass to be used if expected output files should be updated instead of checked. c � � e Zd ZdZdZdZdS )�"LintModuleOutputUpdate.TestDialectzDialect used by the csv writer.�:� N)�__name__� __module__�__qualname__�__doc__� delimiter�lineterminator� � ��/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/testutils/functional/lint_module_output_update.py�TestDialectr s � � � � � �-�-�� ����r r �testN� test_filer �config� Config | None�return�Nonec �x �� t st d� � �t � � � ||� � d S )Nz�You need at least python 3.8 for the functional test updater to work. This is because python 3.8 includes a new AST parser, which amongst others returns the end line and end column of most nodes.)r �RuntimeError�super�__init__)�selfr r � __class__s �r r# zLintModuleOutputUpdate.__init__ sG �� � � ��E�� � � ������F�+�+�+�+�+r �_r �expected_output�list[OutputLine]� actual_outputc � � |sK|sIt j � | j j � � rt j | j j � � dS t | j j dd�� � 5 }t j |d�� � }|D ])}|� |� � � � � �* ddd� � dS # 1 swxY w Y dS )zDOverwrite or remove the expected output file based on actual output.N�wzutf-8)�encodingr )�dialect)�os�path�exists� _test_filer'