summaryrefslogtreecommitdiff
path: root/test/engine/test_transaction.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-07-02 13:14:21 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-07-02 13:14:21 -0400
commitd3d10c982c8a44c85a0114c491207297eac7611d (patch)
treebdfda394fb23cc8d65c0acb77ca070937d93580a /test/engine/test_transaction.py
parent38c5e870a7883df0ae104df828217e326f6cff6a (diff)
downloadsqlalchemy-d3d10c982c8a44c85a0114c491207297eac7611d.tar.gz
- refactor pool a bit so that intent between ConnectionRecord/ConnectionFairy is clear;
make sure that the DBAPI connection passed to the reset-on-return events/dialect hooks is also a "fairy", so that dictionaries like "info" are available. [ticket:2770] - rework the execution_options system so that the dialect is given the job of making any immediate adjustments based on a set event. move the "isolation level" logic to use this new system. Also work things out so that even engine-level execution options can be used for things like isolation level; the dialect attaches a connect-event handler in this case to handle the task. - to support this new system as well as further extensibiltiy of execution options add events engine_connect(), set_connection_execution_options(), set_engine_execution_options()
Diffstat (limited to 'test/engine/test_transaction.py')
-rw-r--r--test/engine/test_transaction.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/engine/test_transaction.py b/test/engine/test_transaction.py
index 789c15444..ffc12b5b9 100644
--- a/test/engine/test_transaction.py
+++ b/test/engine/test_transaction.py
@@ -1279,15 +1279,15 @@ class IsolationLevelTest(fixtures.TestBase):
)
- def test_per_engine_bzzt(self):
- assert_raises_message(
- exc.ArgumentError,
- r"'isolation_level' execution option may "
- r"only be specified on Connection.execution_options\(\). "
- r"To set engine-wide isolation level, "
- r"use the isolation_level argument to create_engine\(\).",
- create_engine,
- testing.db.url,
- execution_options={'isolation_level':
- self._non_default_isolation_level}
+ def test_per_engine(self):
+ # new in 0.9
+ eng = create_engine(testing.db.url,
+ execution_options={
+ 'isolation_level':
+ self._non_default_isolation_level()}
+ )
+ conn = eng.connect()
+ eq_(
+ eng.dialect.get_isolation_level(conn.connection),
+ self._non_default_isolation_level()
)