File: //lib/python3/dist-packages/devscripts/test/__pycache__/test_flake8.cpython-310.pyc
o
���a� � @ sB d Z ddlZddlZddlZddlmZmZ G dd� dej�ZdS )z!test_flake8.py - Run flake8 check� N� )�get_source_files�unittest_verbosityc @ s e Zd ZdZdd� ZdS )�Flake8TestCasez�
This unittest class provides a test that runs the flake8 code
checker (which combines pycodestyle and pyflakes) on the Python
source code. The list of source files is provided by the
get_source_files() function.
c C s� t jdddgt� }t� dkrt j�d�d�|��� tj |tj
tj
dd��O}|�� \}}|jd krmg }|rD|�
d
�|j|�� �� �� |rR|�
d�|�� �� �� |s]|�
d�|j�� | �d
�|�� W d � dS W d � dS 1 sxw Y dS )z&Test: Run flake8 on Python source codez-m�flake8z--max-line-length=99� zRunning following command:
{}
� T)�stdout�stderr� close_fdsr zBflake8 exited with code {} and has unexpected output on stderr:
{}zflake8 found issues:
{}zAflake8 exited with code {} and has no output on stdout or stderr.�
N)�sys�
executabler r r
�write�format�join�
subprocess�Popen�PIPE�communicate�
returncode�append�decode�rstrip�fail)�self�cmd�process�out�err�msgs� r! �=/usr/lib/python3/dist-packages/devscripts/test/test_flake8.py�test_flake8 s8
�
�
�
���"�zFlake8TestCase.test_flake8N)�__name__�
__module__�__qualname__�__doc__r# r! r! r! r"