Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed483ba

Browse files
committed
String exceptions are gone and so are classic classes.
1 parent 28c3198 commit ed483ba

1 file changed

Lines changed: 0 additions & 40 deletions

File tree

Lib/test/test_pep352.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff 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-
177139
def test_main():
178140
run_unittest(ExceptionClassTests, UsageTests)
179141

180-
181-
182142
if __name__ == '__main__':
183143
test_main()

0 commit comments

Comments
 (0)