Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Private Attributes
test.support.WarningsRecorder Class Reference
Inheritance diagram for test.support.WarningsRecorder:
Inheritance graph
[legend]
Collaboration diagram for test.support.WarningsRecorder:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __getattr__
def warnings
def reset

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Private Attributes

 _warnings
 _last

Detailed Description

Convenience wrapper for the warnings list returned on
   entry to the warnings.catch_warnings() context manager.

Definition at line 638 of file support.py.


Constructor & Destructor Documentation

def test.support.WarningsRecorder.__init__ (   self,
  warnings_list 
)

Definition at line 642 of file support.py.

00642 
00643     def __init__(self, warnings_list):
00644         self._warnings = warnings_list
00645         self._last = 0

Here is the caller graph for this function:


Member Function Documentation

def test.support.WarningsRecorder.__getattr__ (   self,
  attr 
)

Definition at line 646 of file support.py.

00646 
00647     def __getattr__(self, attr):
00648         if len(self._warnings) > self._last:
00649             return getattr(self._warnings[-1], attr)
00650         elif attr in warnings.WarningMessage._WARNING_DETAILS:
00651             return None
00652         raise AttributeError("%r has no attribute %r" % (self, attr))

Here is the call graph for this function:

Definition at line 657 of file support.py.

00657 
00658     def reset(self):
00659         self._last = len(self._warnings)
00660 

Here is the caller graph for this function:

Definition at line 654 of file support.py.

00654 
00655     def warnings(self):
00656         return self._warnings[self._last:]


Member Data Documentation

Definition at line 644 of file support.py.

Definition at line 643 of file support.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.


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