summaryrefslogtreecommitdiff
path: root/test/base
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-11-07 12:49:48 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2010-11-07 12:49:48 -0500
commit13fedc23ecca81d0881a994a45efae3a77b74fcb (patch)
treebb5cb4e6b407e3eacd2284e1e42f24c53c8af401 /test/base
parent1f2423d23cc3e8bf8db60b56436752fbd3d83f9d (diff)
downloadsqlalchemy-13fedc23ecca81d0881a994a45efae3a77b74fcb.tar.gz
- propagate flag on event.listen() results in the listener being placed
in a separate collection. this collection also propagates during update() - ClassManager now handles bases, subclasses collections. - ClassManager looks at __bases__ instead of __mro__ for superclasses. It's assumed ClassManagers are in an unbroken chain upwards through __mro__. - trying to get a clear() that makes sense on cls.dispatch - implemented propagate for attribute events, plus permutation-based test - implemented propagate for mapper / instance events with rudimentary test - some pool events tests are failing for some reason
Diffstat (limited to 'test/base')
-rw-r--r--test/base/test_dependency.py9
-rw-r--r--test/base/test_events.py14
2 files changed, 2 insertions, 21 deletions
diff --git a/test/base/test_dependency.py b/test/base/test_dependency.py
index 9fddfc47f..605a16cc3 100644
--- a/test/base/test_dependency.py
+++ b/test/base/test_dependency.py
@@ -1,6 +1,7 @@
import sqlalchemy.topological as topological
from sqlalchemy.test import TestBase
from sqlalchemy.test.testing import assert_raises, eq_
+from sqlalchemy.test.util import conforms_partial_ordering
from sqlalchemy import exc, util
@@ -12,13 +13,7 @@ class DependencySortTest(TestBase):
else:
allitems = self._nodes_from_tuples(tuples).union(allitems)
result = list(topological.sort(tuples, allitems))
- deps = util.defaultdict(set)
- for parent, child in tuples:
- deps[parent].add(child)
- assert len(result)
- for i, node in enumerate(result):
- for n in result[i:]:
- assert node not in deps[n]
+ assert conforms_partial_ordering(tuples, result)
def _nodes_from_tuples(self, tups):
s = set()
diff --git a/test/base/test_events.py b/test/base/test_events.py
index 995569c60..292059877 100644
--- a/test/base/test_events.py
+++ b/test/base/test_events.py
@@ -262,17 +262,3 @@ class TestPropagate(TestBase):
t2.dispatch.on_event_one(t2, 1)
t2.dispatch.on_event_two(t2, 2)
eq_(result, [(t2, 1)])
-
-
-
-
-
-
-
-
-
-
-
-
-
- \ No newline at end of file