From ab2594e341f84b74634d21413e9559fa92e5cbbe Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 1 Sep 2015 10:38:09 +0300 Subject: [PATCH] tests: Add test for exception-chaining raise syntax. --- tests/basics/exception_chain.py | 6 ++++++ tests/basics/exception_chain.py.exp | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 tests/basics/exception_chain.py create mode 100644 tests/basics/exception_chain.py.exp diff --git a/tests/basics/exception_chain.py b/tests/basics/exception_chain.py new file mode 100644 index 000000000..c3a7d6b11 --- /dev/null +++ b/tests/basics/exception_chain.py @@ -0,0 +1,6 @@ +# Exception chaining is not supported, but check that basic +# exception works as expected. +try: + raise Exception from None +except Exception: + print("Caught Exception") diff --git a/tests/basics/exception_chain.py.exp b/tests/basics/exception_chain.py.exp new file mode 100644 index 000000000..80bcd5d0e --- /dev/null +++ b/tests/basics/exception_chain.py.exp @@ -0,0 +1,2 @@ +Caught Exception +Warning: exception chaining not supported