Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
_TextTestResult Class Reference
Inheritance diagram for _TextTestResult:
TestResult

Public Member Functions

def __init__
 
def getDescription
 
def startTest
 
def addSuccess
 
def addError
 
def addFailure
 
def printErrors
 
def printErrorList
 
- Public Member Functions inherited from TestResult
def __init__
 
def startTest
 
def stopTest
 
def addError
 
def addFailure
 
def addSuccess
 
def wasSuccessful
 
def stop
 
def __repr__
 

Data Fields

 stream
 
 showAll
 
 dots
 
 descriptions
 
- Data Fields inherited from TestResult
 failures
 
 errors
 
 testsRun
 
 shouldStop
 

Static Public Attributes

string separator1 = '='
 
string separator2 = '-'
 

Detailed Description

A test result class that can print formatted text results to a stream.

Used by TextTestRunner.

Definition at line 532 of file unittest.py.

Constructor & Destructor Documentation

def __init__ (   self,
  stream,
  descriptions,
  verbosity 
)

Definition at line 540 of file unittest.py.

541  def __init__(self, stream, descriptions, verbosity):
542  TestResult.__init__(self)
543  self.stream = stream
544  self.showAll = verbosity > 1
545  self.dots = verbosity == 1
546  self.descriptions = descriptions

Member Function Documentation

def addError (   self,
  test,
  err 
)

Definition at line 566 of file unittest.py.

References _TextTestResult.dots, and _TextTestResult.showAll.

567  def addError(self, test, err):
568  TestResult.addError(self, test, err)
569  if self.showAll:
570  self.stream.writeln("ERROR")
571  elif self.dots:
572  self.stream.write('E')
def addFailure (   self,
  test,
  err 
)

Definition at line 573 of file unittest.py.

References _TextTestResult.dots, and _TextTestResult.showAll.

574  def addFailure(self, test, err):
575  TestResult.addFailure(self, test, err)
576  if self.showAll:
577  self.stream.writeln("FAIL")
578  elif self.dots:
579  self.stream.write('F')
def addSuccess (   self,
  test 
)

Definition at line 559 of file unittest.py.

References _TextTestResult.dots, and _TextTestResult.showAll.

560  def addSuccess(self, test):
561  TestResult.addSuccess(self, test)
562  if self.showAll:
563  self.stream.writeln("ok")
564  elif self.dots:
565  self.stream.write('.')
def getDescription (   self,
  test 
)

Definition at line 547 of file unittest.py.

References _TextTestResult.descriptions, and locale.str().

548  def getDescription(self, test):
549  if self.descriptions:
550  return test.shortDescription() or str(test)
551  else:
552  return str(test)
def printErrorList (   self,
  flavour,
  errors 
)

Definition at line 586 of file unittest.py.

References _TextTestResult.getDescription(), _TextTestResult.separator1, and _TextTestResult.separator2.

587  def printErrorList(self, flavour, errors):
588  for test, err in errors:
589  self.stream.writeln(self.separator1)
590  self.stream.writeln("%s: %s" % (flavour,self.getDescription(test)))
591  self.stream.writeln(self.separator2)
592  self.stream.writeln("%s" % err)
593 
def printErrors (   self)

Definition at line 580 of file unittest.py.

References _TextTestResult.dots, TestResult.errors, StreamWriter.errors, ParsingError.errors, StreamReader.errors, StreamReaderWriter.errors, StreamRecoder.errors, TestResult.failures, _TextTestResult.printErrorList(), and _TextTestResult.showAll.

581  def printErrors(self):
582  if self.dots or self.showAll:
583  self.stream.writeln()
584  self.printErrorList('ERROR', self.errors)
585  self.printErrorList('FAIL', self.failures)
def startTest (   self,
  test 
)

Definition at line 553 of file unittest.py.

References _TextTestResult.getDescription(), and _TextTestResult.showAll.

554  def startTest(self, test):
555  TestResult.startTest(self, test)
556  if self.showAll:
557  self.stream.write(self.getDescription(test))
558  self.stream.write(" ... ")

Field Documentation

descriptions

Definition at line 545 of file unittest.py.

dots

Definition at line 544 of file unittest.py.

string separator1 = '='
static

Definition at line 537 of file unittest.py.

string separator2 = '-'
static

Definition at line 538 of file unittest.py.

showAll

Definition at line 543 of file unittest.py.

stream

Definition at line 542 of file unittest.py.


The documentation for this class was generated from the following file: