?PNG
IHDR ? f ??C1 sRGB ?? gAMA ?a pHYs ? ??od GIDATx^LeY?a?("Bh?_????q5k?*:t0A-o??]VkJM??f?8\k2ll1]q????T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
Gc @ s d Z d d k l Z d d k l Z d d k l Z d d k l Z d e f d YZ
d e f d YZ d
e f d YZ
d Z d
Z d Z e d j o d d k Z e i n d S( s.
ErrorClass Plugins
------------------
ErrorClass plugins provide an easy way to add support for custom
handling of particular classes of exceptions.
An ErrorClass plugin defines one or more ErrorClasses and how each is
handled and reported on. Each error class is stored in a different
attribute on the result, and reported separately. Each error class must
indicate the exceptions that fall under that class, the label to use
for reporting, and whether exceptions of the class should be
considered as failures for the whole test run.
ErrorClasses use a declarative syntax. Assign an ErrorClass to the
attribute you wish to add to the result object, defining the
exceptions, label and isfailure attributes. For example, to declare an
ErrorClassPlugin that defines TodoErrors (and subclasses of TodoError)
as an error class with the label 'TODO' that is considered a failure,
do this:
>>> class Todo(Exception):
... pass
>>> class TodoError(ErrorClassPlugin):
... todo = ErrorClass(Todo, label='TODO', isfailure=True)
The MetaErrorClass metaclass translates the ErrorClass declarations
into the tuples used by the error handling and reporting functions in
the result. This is an internal format and subject to change; you
should always use the declarative syntax for attaching ErrorClasses to
an ErrorClass plugin.
>>> TodoError.errorClasses # doctest: +ELLIPSIS
((, ('todo', 'TODO', True)),)
Let's see the plugin in action. First some boilerplate.
>>> import sys
>>> import unittest
>>> buf = unittest._WritelnDecorator(sys.stdout)
Now define a test case that raises a Todo.
>>> class TestTodo(unittest.TestCase):
... def runTest(self):
... raise Todo("I need to test something")
>>> case = TestTodo()
Prepare the result using our plugin. Normally this happens during the
course of test execution within nose -- you won't be doing this
yourself. For the purposes of this testing document, I'm stepping
through the internal process of nose so you can see what happens at
each step.
>>> plugin = TodoError()
>>> result = unittest._TextTestResult(stream=buf,
... descriptions=0, verbosity=2)
>>> plugin.prepareTestResult(result)
Now run the test. TODO is printed.
>>> case(result) # doctest: +ELLIPSIS
runTest (....TestTodo) ... TODO: I need to test something
Errors and failures are empty, but todo has our test:
>>> result.errors
[]
>>> result.failures
[]
>>> result.todo # doctest: +ELLIPSIS
[(<....TestTodo testMethod=runTest>, '...Todo: I need to test something\n')]
>>> result.printErrors() # doctest: +ELLIPSIS
======================================================================
TODO: runTest (....TestTodo)
----------------------------------------------------------------------
Traceback (most recent call last):
...
Todo: I need to test something
Since we defined a Todo as a failure, the run was not successful.
>>> result.wasSuccessful()
False
i( t instancemethod( t Plugin( t TextTestResult( t isclasst MetaErrorClassc B s e Z d Z d Z RS( sh Metaclass for ErrorClassPlugins that allows error classes to be
set up in a declarative manner.
c C s g } xn | i D]` \ } } t | t oD | i | x4 | D]( } | i | | | i | i f f qC Wq q Wt t | i | | | t
| | _ d S( N( t itemst
isinstancet
ErrorClasst popt appendt labelt isfailuret superR t __init__t tuplet errorClasses( t selft namet basest attrR t detailt cls( ( s; /usr/lib/python2.6/site-packages/nose/plugins/errorclass.pyR
b s
(( t __name__t
__module__t __doc__R
( ( ( s; /usr/lib/python2.6/site-packages/nose/plugins/errorclass.pyR ^ s R c B s e Z d Z d Z RS( c O sa | | _ y. x' d D] } t | | | i | q WWn# t j
o t d | n Xd S( NR
R s. %r is a required named argument for ErrorClass( s labels isfailure( R t setattrR t KeyErrort TypeError( R R t kwt key( ( s; /usr/lib/python2.6/site-packages/nose/plugins/errorclass.pyR
o s !c C s
t | i S( N( t iterR ( R ( ( s; /usr/lib/python2.6/site-packages/nose/plugins/errorclass.pyt __iter__x s ( R R R
R ( ( ( s; /usr/lib/python2.6/site-packages/nose/plugins/errorclass.pyR n s t ErrorClassPluginc B s5 e Z e Z d Z d Z d Z d Z d Z RS( i c sk | \ } } t p d Sg } | i D] } | | d q/ ~ } t f d | o t Sd S( Ni c s
t | S( ( t
issubclass( t c( t err_cls( s; /usr/lib/python2.6/site-packages/nose/plugins/errorclass.pyt