diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-24 08:08:49 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-24 08:08:49 (GMT) |
commit | ed483ba63b9c03845386976bccff5d95df5b570a (patch) | |
tree | 1a14ad8b1a6f2355723b0404ab3b847cda5249f9 /Lib/test | |
parent | 28c31982eb24f93017d4859e71ce97cb7c463678 (diff) | |
download | cpython-ed483ba63b9c03845386976bccff5d95df5b570a.zip cpython-ed483ba63b9c03845386976bccff5d95df5b570a.tar.gz cpython-ed483ba63b9c03845386976bccff5d95df5b570a.tar.bz2 |
String exceptions are gone and so are classic classes.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_pep352.py | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/Lib/test/test_pep352.py b/Lib/test/test_pep352.py index 251e0be..73cffd2 100644 --- a/Lib/test/test_pep352.py +++ b/Lib/test/test_pep352.py @@ -120,22 +120,6 @@ class UsageTests(unittest.TestCase): def tearDown(self): warnings.filters = self._filters[:] - def test_raise_classic(self): - class ClassicClass: - pass - try: - raise ClassicClass - except ClassicClass: - pass - except: - self.fail("unable to raise classic class") - try: - raise ClassicClass() - except ClassicClass: - pass - except: - self.fail("unable to raise class class instance") - def test_raise_new_style_non_exception(self): class NewStyleClass(object): pass @@ -152,32 +136,8 @@ class UsageTests(unittest.TestCase): except: self.fail("unable to raise new-style class instance") - def test_raise_string(self): - warnings.resetwarnings() - warnings.filterwarnings("error") - try: - raise "spam" - except DeprecationWarning: - pass - except: - self.fail("raising a string did not cause a DeprecationWarning") - - def test_catch_string(self): - # Test will be pertinent when catching exceptions raises a - # DeprecationWarning - warnings.filterwarnings("ignore", "raising") - str_exc = "spam" - try: - raise str_exc - except str_exc: - pass - except: - self.fail("catching a string exception failed") - def test_main(): run_unittest(ExceptionClassTests, UsageTests) - - if __name__ == '__main__': test_main() |