Back to index

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

List of all members.

Public Member Functions

def testInlineGeneratorSyntax
def testUnboundGenerator
def testInlineGeneratorBoundSyntax
def testInlineGeneratorBoundToExistingVariable
def testInlineGeneratorBoundToDottedVariable
def testBoundGenerator
def testNestedSingleStatements
def setUp
def assertInWithManagerInvariants
def assertAfterWithManagerInvariants
def assertAfterWithManagerInvariantsNoError
def assertInWithGeneratorInvariants
def assertAfterWithGeneratorInvariantsNoError
def raiseTestException
def assertAfterWithManagerInvariantsWithError
def assertAfterWithGeneratorInvariantsWithError

Public Attributes

 TEST_EXCEPTION
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Detailed Description

Definition at line 235 of file test_with.py.


Member Function Documentation

Definition at line 211 of file test_with.py.

00211 
00212     def assertAfterWithGeneratorInvariantsNoError(self, mock_generator):
00213         self.assertTrue(mock_generator.yielded)
00214         self.assertTrue(mock_generator.stopped)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 230 of file test_with.py.

00230 
00231     def assertAfterWithGeneratorInvariantsWithError(self, mock_generator):
00232         self.assertTrue(mock_generator.yielded)
00233         self.assertTrue(mock_generator.stopped)
00234 

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_with.ContextmanagerAssertionMixin.assertAfterWithManagerInvariants (   self,
  mock_manager,
  exit_args 
) [inherited]

Definition at line 198 of file test_with.py.

00198 
00199     def assertAfterWithManagerInvariants(self, mock_manager, exit_args):
00200         self.assertTrue(mock_manager.enter_called)
00201         self.assertTrue(mock_manager.exit_called)
00202         self.assertEqual(mock_manager.exit_args, exit_args)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 203 of file test_with.py.

00203 
00204     def assertAfterWithManagerInvariantsNoError(self, mock_manager):
00205         self.assertAfterWithManagerInvariants(mock_manager,
00206             (None, None, None))

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_with.ContextmanagerAssertionMixin.assertAfterWithManagerInvariantsWithError (   self,
  mock_manager,
  exc_type = None 
) [inherited]

Definition at line 219 of file test_with.py.

00219 
00220                                                   exc_type=None):
00221         self.assertTrue(mock_manager.enter_called)
00222         self.assertTrue(mock_manager.exit_called)
00223         if exc_type is None:
00224             self.assertEqual(mock_manager.exit_args[1], self.TEST_EXCEPTION)
00225             exc_type = type(self.TEST_EXCEPTION)
00226         self.assertEqual(mock_manager.exit_args[0], exc_type)
00227         # Test the __exit__ arguments. Issue #7853
00228         self.assertIsInstance(mock_manager.exit_args[1], exc_type)
00229         self.assertIsNot(mock_manager.exit_args[2], None)

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_with.ContextmanagerAssertionMixin.assertInWithGeneratorInvariants (   self,
  mock_generator 
) [inherited]

Definition at line 207 of file test_with.py.

00207 
00208     def assertInWithGeneratorInvariants(self, mock_generator):
00209         self.assertTrue(mock_generator.yielded)
00210         self.assertFalse(mock_generator.stopped)

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_with.ContextmanagerAssertionMixin.assertInWithManagerInvariants (   self,
  mock_manager 
) [inherited]

Definition at line 193 of file test_with.py.

00193 
00194     def assertInWithManagerInvariants(self, mock_manager):
00195         self.assertTrue(mock_manager.enter_called)
00196         self.assertFalse(mock_manager.exit_called)
00197         self.assertEqual(mock_manager.exit_args, None)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 215 of file test_with.py.

00215 
00216     def raiseTestException(self):
00217         raise self.TEST_EXCEPTION

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 190 of file test_with.py.

00190 
00191     def setUp(self):
00192         self.TEST_EXCEPTION = RuntimeError("test exception")

Here is the caller graph for this function:

Definition at line 263 of file test_with.py.

00263 
00264     def testBoundGenerator(self):
00265         mock = mock_contextmanager_generator()
00266         with mock as foo:
00267             self.assertInWithGeneratorInvariants(foo)
00268             self.assertInWithManagerInvariants(mock)
00269         self.assertAfterWithGeneratorInvariantsNoError(foo)
00270         self.assertAfterWithManagerInvariantsNoError(mock)

Here is the call graph for this function:

Definition at line 246 of file test_with.py.

00246 
00247     def testInlineGeneratorBoundSyntax(self):
00248         with mock_contextmanager_generator() as foo:
00249             self.assertInWithGeneratorInvariants(foo)
00250         # FIXME: In the future, we'll try to keep the bound names from leaking
00251         self.assertAfterWithGeneratorInvariantsNoError(foo)

Here is the call graph for this function:

Definition at line 258 of file test_with.py.

Here is the call graph for this function:

Definition at line 252 of file test_with.py.

Here is the call graph for this function:

Definition at line 236 of file test_with.py.

00236 
00237     def testInlineGeneratorSyntax(self):
00238         with mock_contextmanager_generator():
00239             pass

Here is the call graph for this function:

Definition at line 271 of file test_with.py.

00271 
00272     def testNestedSingleStatements(self):
00273         mock_a = mock_contextmanager_generator()
00274         with mock_a as foo:
00275             mock_b = mock_contextmanager_generator()
00276             with mock_b as bar:
00277                 self.assertInWithManagerInvariants(mock_a)
00278                 self.assertInWithManagerInvariants(mock_b)
00279                 self.assertInWithGeneratorInvariants(foo)
00280                 self.assertInWithGeneratorInvariants(bar)
00281             self.assertAfterWithManagerInvariantsNoError(mock_b)
00282             self.assertAfterWithGeneratorInvariantsNoError(bar)
00283             self.assertInWithManagerInvariants(mock_a)
00284             self.assertInWithGeneratorInvariants(foo)
00285         self.assertAfterWithManagerInvariantsNoError(mock_a)
00286         self.assertAfterWithGeneratorInvariantsNoError(foo)
00287 

Here is the call graph for this function:

Definition at line 240 of file test_with.py.

00240 
00241     def testUnboundGenerator(self):
00242         mock = mock_contextmanager_generator()
00243         with mock:
00244             pass
00245         self.assertAfterWithManagerInvariantsNoError(mock)

Here is the call graph for this function:


Member Data Documentation

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

Definition at line 191 of file test_with.py.


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