From c4bd01a68bd2e4a029000d98f35f6863b1766827 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 24 Jul 2017 12:13:05 -0400 Subject: [PATCH] Ensure we check for boolean condition when we inspect __exit__() Fixed issue in testing fixtures which was incompatible with a change made as of Python 3.6.2 involving context managers. Change-Id: I0f12aa6cc15cba89153f7e4888ac347e7ce599c7 Fixes: #4034 (cherry picked from commit 7d4005156b5a48989dae7c4424faafc03cc8410d) --- doc/build/changelog/unreleased_10/4034.rst | 7 +++++++ lib/sqlalchemy/testing/util.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 doc/build/changelog/unreleased_10/4034.rst diff --git a/doc/build/changelog/unreleased_10/4034.rst b/doc/build/changelog/unreleased_10/4034.rst new file mode 100644 index 0000000000..ac4f229b0b --- /dev/null +++ b/doc/build/changelog/unreleased_10/4034.rst @@ -0,0 +1,7 @@ +.. change:: + :tags: bug, tests, py3k + :tickets: 4034 + :versions: 1.0.18, 1.1.12, 1.2.0b2 + + Fixed issue in testing fixtures which was incompatible with a change + made as of Python 3.6.2 involving context managers. \ No newline at end of file diff --git a/lib/sqlalchemy/testing/util.py b/lib/sqlalchemy/testing/util.py index 8f91f31ed3..5e305461d6 100644 --- a/lib/sqlalchemy/testing/util.py +++ b/lib/sqlalchemy/testing/util.py @@ -161,7 +161,7 @@ def run_as_contextmanager(ctx, fn, *arg, **kw): except: exc_info = sys.exc_info() raise_ = ctx.__exit__(*exc_info) - if raise_ is None: + if not raise_: raise else: return raise_ -- 2.47.2