Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/trial/_dist/__pycache__/disttrial.cpython-39.pyc
Ðазад
a k�h�! � @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m Z ddlmZ ddl mZmZ dd lmZ dd lmZmZ ddlmZ ddlmZ G d d� d�ZdS )z� This module contains the trial distributed runner, the management class responsible for coordinating all of trial's behavior at the highest level. @since: 12.3 � N)�DeferredList�� cooperate)�FilePath)� theSystemPath)� _iterateTests)�_WORKER_AMP_STDIN�_WORKER_AMP_STDOUT)�DistReporter)�LocalWorker�LocalWorkerAMP)�UncleanWarningsReporterWrapper)�_unusedTestDirectoryc @ s^ e Zd ZdZeZdd� Zdd d �Zdd� Zd d� Z dd� Z dd� Zdedfdd�Z dd� ZdS )�DistTrialRunneraY A specialized runner for distributed trial. The runner launches a number of local worker processes which will run tests. @ivar _workerNumber: the number of workers to be spawned. @type _workerNumber: C{int} @ivar _stream: stream which the reporter will use. @ivar _reporterFactory: the reporter class to be used. c C s. | j | j| j| jd�}| jr$t|�}| �|�S )zL Make reporter factory, and wrap it with a L{DistReporter}. )Zrealtime)�_reporterFactory�_stream� _tbformat� _rterrors�_uncleanWarningsr �_distReporterFactory)�self�reporter� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/trial/_dist/disttrial.py�_makeResult* s �zDistTrialRunner._makeResultN�defaultF�test.log�_trial_tempc C s` || _ || _|| _|d u r tj}|| _|| _|| _|| _d | _ | | _ || _d | _d | _ d| _d S )NF)� _workerNumber�_workerArgumentsr �sys�stdoutr r r r �_result�_workingDirectory�_logFileZ_logFileObserverZ_logFileObjectZ_logWarnings) r ZreporterFactory�workerNumberZworkerArguments�streamZtracebackFormatZrealTimeErrorsZuncleanWarningsZlogfile�workingDirectoryr r r �__init__5 s zDistTrialRunner.__init__c C s |� � dS )z� Write test run final outcome to result. @param result: A C{TestResult} which will print errors and the summary. N)�done)r �resultr r r �writeResultsQ s zDistTrialRunner.writeResultsc s � �fdd�t |�D �S )aY Create local worker protocol instances and return them. @param protocols: An iterable of L{LocalWorkerAMP} instances. @param workingDirectory: The base path in which we should run the workers. @type workingDirectory: C{str} @return: A list of C{quantity} C{LocalWorker} instances. c s, g | ]$\}}t |tj��t|��� j��qS r )r �os�path�join�strr$ )�.0�x�protocol�r r'