Server : Apache System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64 User : dh_edsupp ( 6597262) PHP Version : 8.2.26 Disable Function : NONE Directory : /lib/python3/dist-packages/devscripts/test/__pycache__/ |
Upload File : |
o ���aN � @ s� d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl m Z mZ ej� ej�e�d�Zdd� Ze�e� d �G d d� dej��ZdS )ztest_pylint.py - Run pylint� N)�Version� )�get_source_files�unittest_verbosityzpylint.confc C s t tj�t d�kS )Nz2.11.1)r �pylint�__version__� r r �=/usr/lib/python3/dist-packages/devscripts/test/test_pylint.py�check_pylint_version s r zpylint version not supportedc @ s e Zd ZdZdd� ZdS )�PylintTestCasez� This unittest class provides a test that runs the pylint code check on the Python source code. The list of source files is provided by the get_source_files() function and pylint is purely configured via a config file. c C s4 t � }|�d� tjdddt dg| }t� dkr%tj�d�d� |��� t j|t jt jd d ��`}|� � \}}|jdkr�tjdd |�� tjd��� }t�dd |�� ��� }g }|rc|�d�|j|�� |rm|�d�|�� |sx|�d�|j�� | �d� |�� W d � dS W d � dS 1 s�w Y dS )z&Test: Run pylint on Python source code� debootsnapz-mr z --rcfile=z--� zRunning following command: {} � T)�stdout�stderr� close_fdsr z%^(-+|Your code has been rated at .*)$� )�flagsz^Using config file .* zBpylint exited with code {} and has unexpected output on stderr: {}zpylint found issues: {}zApylint exited with code {} and has no output on stdout or stderr.� N)r �remove�sys� executable�CONFIGr r �write�format�join� subprocess�Popen�PIPE�communicate� returncode�re�sub�decode� MULTILINE�rstrip�append�fail)�self�files�cmd�process�out�err�msgsr r r �test_pylint, s@ � �� ���"�zPylintTestCase.test_pylintN)�__name__� __module__�__qualname__�__doc__r/ r r r r r # s r )r3 �osr! r r �unittestr �debian.debian_supportr r r r �pathr �dirname�__file__r r �skipIf�TestCaser r r r r �<module> s