summaryrefslogtreecommitdiff
path: root/test/engine
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2018-02-19 16:59:42 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2018-02-19 17:01:43 -0500
commit1393eac44c49299e733a5181f387ba140aaa3e44 (patch)
tree228ea8203b49c247280e2b2bfdc314df1fc47629 /test/engine
parent20aee85b44cb8847aedb4196dc720a7feea0f584 (diff)
downloadsqlalchemy-1393eac44c49299e733a5181f387ba140aaa3e44.tar.gz
Implement remove() for _empty_collection
Fixed regression caused in 1.2.3 due to fix from :ticket:`4181` where the changes to the event system involving :class:`.Engine` and :class:`.OptionEngine` did not accommodate for event removals, which would raise an ``AttributeError`` when invoked at the class level. Change-Id: I1c9083829d74dd710716d28b0eaca4fa15e86313 Fixes: #4190
Diffstat (limited to 'test/engine')
-rw-r--r--test/engine/test_execute.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py
index e0727f770..2d602fa12 100644
--- a/test/engine/test_execute.py
+++ b/test/engine/test_execute.py
@@ -1399,6 +1399,15 @@ class EngineEventsTest(fixtures.TestBase):
eq_(canary, ["l1", "l2", "l3", "l4", "l1", "l2", "l3"])
+ canary[:] = []
+
+ event.remove(Engine, "before_execute", l1)
+ event.remove(eng1, "before_execute", l4)
+ event.remove(eng, "before_execute", l3)
+
+ eng1.execute(select([1])).close()
+ eq_(canary, ["l2"])
+
@testing.requires.ad_hoc_engines
def test_cant_listen_to_option_engine(self):
from sqlalchemy.engine import base