summaryrefslogtreecommitdiff
path: root/test/base
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2021-12-27 21:04:54 +0000
committerGerrit Code Review <gerrit@ci3.zzzcomputing.com>2021-12-27 21:04:54 +0000
commitc5b8f2f88bb487ce9bd4aac6173c445fa307ae07 (patch)
treee28194a1edb222b7de87126933c579db53e14bd0 /test/base
parent9eb5e153c93b6a01f16453bd45b4bda9411fb414 (diff)
parent13e6e5608898a2c85751372ba88d357e5b80fe3f (diff)
downloadsqlalchemy-c5b8f2f88bb487ce9bd4aac6173c445fa307ae07.tar.gz
Merge "Replace raise_ with raise from" into main
Diffstat (limited to 'test/base')
-rw-r--r--test/base/test_utils.py60
1 files changed, 0 insertions, 60 deletions
diff --git a/test/base/test_utils.py b/test/base/test_utils.py
index 9278bd268..2a912f349 100644
--- a/test/base/test_utils.py
+++ b/test/base/test_utils.py
@@ -2988,66 +2988,6 @@ class TestClassHierarchy(fixtures.TestBase):
eq_(set(util.class_hierarchy(B)), set((A, B, C, object)))
-class ReraiseTest(fixtures.TestBase):
- def test_raise_from_cause_same_cause(self):
- class MyException(Exception):
- pass
-
- def go():
- try:
- raise MyException("exc one")
- except Exception as err:
- util.raise_from_cause(err)
-
- try:
- go()
- assert False
- except MyException as err:
- is_(err.__cause__, None)
-
- def test_raise_from_cause_legacy(self):
- class MyException(Exception):
- pass
-
- class MyOtherException(Exception):
- pass
-
- me = MyException("exc on")
-
- def go():
- try:
- raise me
- except Exception:
- util.raise_from_cause(MyOtherException("exc two"))
-
- try:
- go()
- assert False
- except MyOtherException as moe:
- is_(moe.__cause__, me)
-
- def test_raise_from(self):
- class MyException(Exception):
- pass
-
- class MyOtherException(Exception):
- pass
-
- me = MyException("exc on")
-
- def go():
- try:
- raise me
- except Exception as err:
- util.raise_(MyOtherException("exc two"), from_=err)
-
- try:
- go()
- assert False
- except MyOtherException as moe:
- is_(moe.__cause__, me)
-
-
class TestClassProperty(fixtures.TestBase):
def test_simple(self):
class A: