Back to index

python3.2  3.2.2
Public Member Functions
test.test_exception_variations.ExceptionTestCase Class Reference

List of all members.

Public Member Functions

def test_try_except_else_finally
def test_try_except_else_finally_no_exception
def test_try_except_finally
def test_try_except_finally_no_exception
def test_try_except
def test_try_except_no_exception
def test_try_except_else
def test_try_except_else_no_exception
def test_try_finally_no_exception
def test_nested
def test_nested_else

Detailed Description

Definition at line 5 of file test_exception_variations.py.


Member Function Documentation

Definition at line 128 of file test_exception_variations.py.

00128 
00129     def test_nested(self):
00130         hit_finally = False
00131         hit_inner_except = False
00132         hit_inner_finally = False
00133 
00134         try:
00135             try:
00136                 raise Exception('inner exception')
00137             except:
00138                 hit_inner_except = True
00139             finally:
00140                 hit_inner_finally = True
00141         finally:
00142             hit_finally = True
00143 
00144         self.assertTrue(hit_inner_except)
00145         self.assertTrue(hit_inner_finally)
00146         self.assertTrue(hit_finally)

Here is the call graph for this function:

Definition at line 147 of file test_exception_variations.py.

00147 
00148     def test_nested_else(self):
00149         hit_else = False
00150         hit_finally = False
00151         hit_except = False
00152         hit_inner_except = False
00153         hit_inner_else = False
00154 
00155         try:
00156             try:
00157                 pass
00158             except:
00159                 hit_inner_except = True
00160             else:
00161                 hit_inner_else = True
00162 
00163             raise Exception('outer exception')
00164         except:
00165             hit_except = True
00166         else:
00167             hit_else = True
00168         finally:
00169             hit_finally = True
00170 
00171         self.assertFalse(hit_inner_except)
00172         self.assertTrue(hit_inner_else)
00173         self.assertFalse(hit_else)
00174         self.assertTrue(hit_finally)
00175         self.assertTrue(hit_except)

Here is the call graph for this function:

Definition at line 70 of file test_exception_variations.py.

00070 
00071     def test_try_except(self):
00072         hit_except = False
00073 
00074         try:
00075             raise Exception('ahoy!')
00076         except:
00077             hit_except = True
00078 
00079         self.assertTrue(hit_except)

Here is the call graph for this function:

Definition at line 90 of file test_exception_variations.py.

00090 
00091     def test_try_except_else(self):
00092         hit_except = False
00093         hit_else = False
00094 
00095         try:
00096             raise Exception('foo!')
00097         except:
00098             hit_except = True
00099         else:
00100             hit_else = True
00101 
00102         self.assertFalse(hit_else)
00103         self.assertTrue(hit_except)

Here is the call graph for this function:

Definition at line 6 of file test_exception_variations.py.

00006 
00007     def test_try_except_else_finally(self):
00008         hit_except = False
00009         hit_else = False
00010         hit_finally = False
00011 
00012         try:
00013             raise Exception('nyaa!')
00014         except:
00015             hit_except = True
00016         else:
00017             hit_else = True
00018         finally:
00019             hit_finally = True
00020 
00021         self.assertTrue(hit_except)
00022         self.assertTrue(hit_finally)
00023         self.assertFalse(hit_else)

Here is the call graph for this function:

Definition at line 24 of file test_exception_variations.py.

00024 
00025     def test_try_except_else_finally_no_exception(self):
00026         hit_except = False
00027         hit_else = False
00028         hit_finally = False
00029 
00030         try:
00031             pass
00032         except:
00033             hit_except = True
00034         else:
00035             hit_else = True
00036         finally:
00037             hit_finally = True
00038 
00039         self.assertFalse(hit_except)
00040         self.assertTrue(hit_finally)
00041         self.assertTrue(hit_else)

Here is the call graph for this function:

Definition at line 104 of file test_exception_variations.py.

00104 
00105     def test_try_except_else_no_exception(self):
00106         hit_except = False
00107         hit_else = False
00108 
00109         try:
00110             pass
00111         except:
00112             hit_except = True
00113         else:
00114             hit_else = True
00115 
00116         self.assertFalse(hit_except)
00117         self.assertTrue(hit_else)

Here is the call graph for this function:

Definition at line 42 of file test_exception_variations.py.

00042 
00043     def test_try_except_finally(self):
00044         hit_except = False
00045         hit_finally = False
00046 
00047         try:
00048             raise Exception('yarr!')
00049         except:
00050             hit_except = True
00051         finally:
00052             hit_finally = True
00053 
00054         self.assertTrue(hit_except)
00055         self.assertTrue(hit_finally)

Here is the call graph for this function:

Definition at line 56 of file test_exception_variations.py.

00056 
00057     def test_try_except_finally_no_exception(self):
00058         hit_except = False
00059         hit_finally = False
00060 
00061         try:
00062             pass
00063         except:
00064             hit_except = True
00065         finally:
00066             hit_finally = True
00067 
00068         self.assertFalse(hit_except)
00069         self.assertTrue(hit_finally)

Here is the call graph for this function:

Definition at line 80 of file test_exception_variations.py.

00080 
00081     def test_try_except_no_exception(self):
00082         hit_except = False
00083 
00084         try:
00085             pass
00086         except:
00087             hit_except = True
00088 
00089         self.assertFalse(hit_except)

Here is the call graph for this function:

Definition at line 118 of file test_exception_variations.py.

00118 
00119     def test_try_finally_no_exception(self):
00120         hit_finally = False
00121 
00122         try:
00123             pass
00124         finally:
00125             hit_finally = True
00126 
00127         self.assertTrue(hit_finally)

Here is the call graph for this function:


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