← Back
Editing: _synctest.cpython-38.pyc
U ��W[a� � @ s` d Z ddlmZmZ ddlZddlZddlZddlZddlZddl Z ddl mZ ddl mZmZmZ ddlmZ ddlmZ ddlmZmZ dd lmZmZ ddlZejZG d d� de�ZG dd � d e �Z!dd� Z"G dd� de �Z#dd� Z$dd� Z%G dd� de&�Z'G dd� de �Z(G dd� de �Z)G dd� dej*e �Z+G dd� de �Z,e,� Z-G d d!� d!e+�Z.dS )"zP Things likely to be used by writers of unit tests. Maintainer: Jonathan Lange � )�division�absolute_importN)�findlinestarts)�failure�log�monkey)�fullyQualifiedName)�runWithWarningsSuppressed)�getDeprecationWarningString�warnAboutFunction)�itrial�utilc @ s e Zd ZdZdS )�FailTestzA Raised to indicate the current test has failed to pass. N��__name__� __module__�__qualname__�__doc__� r r �9/usr/lib/python3/dist-packages/twisted/trial/_synctest.pyr s r c @ s* e Zd ZdZd dd�Zdd� Zdd� ZdS ) �TodoaK Internal object used to mark a L{TestCase} as 'todo'. Tests marked 'todo' are reported differently in Trial L{TestResult}s. If todo'd tests fail, they do not fail the suite and the errors are reported in a separate category. If todo'd tests succeed, Trial L{TestResult}s will report an unexpected success. Nc C s || _ || _dS )ar @param reason: A string explaining why the test is marked 'todo' @param errors: An iterable of exception types that the test is expected to raise. If one of these errors is raised by the test, it will be trapped. Raising any other kind of error will fail the test. If L{None} is passed, then all errors will be trapped. N��reason�errors)�selfr r r r r �__init__0 s z Todo.__init__c C s d| j | jf S )Nz<Todo reason=%r errors=%r>r �r r r r �__repr__= s z Todo.__repr__c C s. | j dkrdS | j D ]}|�|�r dS qdS )z� @param failure: A L{twisted.python.failure.Failure}. @return: C{True} if C{failure} is expected, C{False} otherwise. NTF)r �check)r r �errorr r r �expectedA s z Todo.expected)N)r r r r r r r r r r r r '