Back to index

python3.2  3.2.2
Public Member Functions
test.test_with.ExitSwallowsExceptionTestCase Class Reference

List of all members.

Public Member Functions

def testExitTrueSwallowsException
def testExitFalseDoesntSwallowException

Detailed Description

Definition at line 641 of file

Member Function Documentation

Definition at line 653 of file

00654     def testExitFalseDoesntSwallowException(self):
00655         class EuropeanSwallow:
00656             def __enter__(self): pass
00657             def __exit__(self, t, v, tb): return False
00658         try:
00659             with EuropeanSwallow():
00660                 1/0
00661         except ZeroDivisionError:
00662             pass
00663         else:
00664   "ZeroDivisionError should have been raised")

Here is the call graph for this function:

Definition at line 643 of file

00644     def testExitTrueSwallowsException(self):
00645         class AfricanSwallow:
00646             def __enter__(self): pass
00647             def __exit__(self, t, v, tb): return True
00648         try:
00649             with AfricanSwallow():
00650                 1/0
00651         except ZeroDivisionError:
00652   "ZeroDivisionError should have been swallowed")

Here is the call graph for this function:

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