Back to index

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

List of all members.

Public Member Functions

def __init__
def __enter__
def __exit__
def __call__

Public Attributes

 enter_called
 exit_called
 exit_args
 gen
 kwds
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Detailed Description

Definition at line 16 of file test_with.py.


Constructor & Destructor Documentation

def test.test_with.MockContextManager.__init__ (   self,
  func,
  args,
  kwds 
)

Reimplemented from contextlib._GeneratorContextManager.

Definition at line 17 of file test_with.py.

00017 
00018     def __init__(self, func, *args, **kwds):
00019         super().__init__(func, *args, **kwds)
00020         self.enter_called = False
00021         self.exit_called = False
00022         self.exit_args = None

Here is the caller graph for this function:


Member Function Documentation

def contextlib.ContextDecorator.__call__ (   self,
  func 
) [inherited]

Definition at line 25 of file contextlib.py.

00025 
00026     def __call__(self, func):
00027         @wraps(func)
00028         def inner(*args, **kwds):
00029             with self._recreate_cm():
00030                 return func(*args, **kwds)
00031         return inner
00032 

Here is the call graph for this function:

Reimplemented from contextlib._GeneratorContextManager.

Definition at line 23 of file test_with.py.

00023 
00024     def __enter__(self):
00025         self.enter_called = True
00026         return _GeneratorContextManager.__enter__(self)

def test.test_with.MockContextManager.__exit__ (   self,
  type,
  value,
  traceback 
)

Reimplemented from contextlib._GeneratorContextManager.

Definition at line 27 of file test_with.py.

00027 
00028     def __exit__(self, type, value, traceback):
00029         self.exit_called = True
00030         self.exit_args = (type, value, traceback)
00031         return _GeneratorContextManager.__exit__(self, type,
00032                                                  value, traceback)
00033 

Here is the caller graph for this function:


Member Data Documentation

Definition at line 19 of file test_with.py.

Definition at line 21 of file test_with.py.

Definition at line 20 of file test_with.py.

Definition at line 37 of file contextlib.py.

Definition at line 38 of file contextlib.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: