test failure as of Python 3.6.2
released just on July 17:
SessionStateTest.test_with_no_autoflush_after_exception _________________________________________
Traceback (most recent call last):
File "/home/classic/dev/sqlalchemy/test/orm/test_session.py", line 324, in test_with_no_autoflush_after_exception
lambda obj: 1 / 0
File "/home/classic/dev/sqlalchemy/test/../lib/sqlalchemy/testing/assertions.py", line 279, in assert_raises
assert success, "Callable did not raise an exception"
AssertionError: Callable did not raise an exception
============================================= 1 failed, 77 passed, 4 skipped in 1.92 seconds ==============================================
clearly, 1/0 raises ZeroDivisionError by itself, someting is up with the fixtures or pytest or something. does not appear on 3.6.0.
Comments (5)
-
reporter -
reporter OK the issue is the context manager simulator isn't following the spec per
__exit__()
correctly, this is the fix:diff --git a/lib/sqlalchemy/testing/util.py b/lib/sqlalchemy/testing/util.py index a37637a..fe696bc 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_
probably stick to that for now, however we should probably use "with:" since we are long past Python versions that don't support it.
-
reporter - changed status to resolved
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→ <<cset 7d4005156b5a>>
-
reporter 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)→ <<cset a9f6eef42c67>>
-
reporter 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)→ <<cset c4bd01a68bd2>>
- Log in to comment
this almost needs to be put out on 1.0.x as well, consider that too.