File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,22 +120,6 @@ def setUp(self):
120120 def tearDown (self ):
121121 warnings .filters = self ._filters [:]
122122
123- def test_raise_classic (self ):
124- class ClassicClass :
125- pass
126- try :
127- raise ClassicClass
128- except ClassicClass :
129- pass
130- except :
131- self .fail ("unable to raise classic class" )
132- try :
133- raise ClassicClass ()
134- except ClassicClass :
135- pass
136- except :
137- self .fail ("unable to raise class class instance" )
138-
139123 def test_raise_new_style_non_exception (self ):
140124 class NewStyleClass (object ):
141125 pass
@@ -152,32 +136,8 @@ class NewStyleClass(object):
152136 except :
153137 self .fail ("unable to raise new-style class instance" )
154138
155- def test_raise_string (self ):
156- warnings .resetwarnings ()
157- warnings .filterwarnings ("error" )
158- try :
159- raise "spam"
160- except DeprecationWarning :
161- pass
162- except :
163- self .fail ("raising a string did not cause a DeprecationWarning" )
164-
165- def test_catch_string (self ):
166- # Test will be pertinent when catching exceptions raises a
167- # DeprecationWarning
168- warnings .filterwarnings ("ignore" , "raising" )
169- str_exc = "spam"
170- try :
171- raise str_exc
172- except str_exc :
173- pass
174- except :
175- self .fail ("catching a string exception failed" )
176-
177139def test_main ():
178140 run_unittest (ExceptionClassTests , UsageTests )
179141
180-
181-
182142if __name__ == '__main__' :
183143 test_main ()
You can’t perform that action at this time.
0 commit comments