Re: [Sqlalchemy-tickets] [sqlalchemy] #2794: CircularDependencyError with jython because WeakSequen
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-08-02 17:35:25
|
#2794: CircularDependencyError with jython because WeakSequence doesn't preserve
order
----------------------------------+------------------------------------
Reporter: sayap | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: utils | Severity: no triage selected yet
Resolution: | Keywords:
Progress State: awaiting triage |
----------------------------------+------------------------------------
Comment (by zzzeek):
OK great, yeah if I do this and run tests with --reversetop:
{{{
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py
index ae1ca20..1d2d30d 100644
--- a/lib/sqlalchemy/orm/util.py
+++ b/lib/sqlalchemy/orm/util.py
@@ -1327,3 +1327,11 @@ def randomize_unitofwork():
from sqlalchemy.testing.util import RandomSet
topological.set = unitofwork.set = session.set = mapper.set = \
dependency.set = RandomSet
+ from sqlalchemy.util import WeakSequence
+ import random
+ def _random_iter(self):
+ l = self._storage.values()
+ random.shuffle(l)
+ return iter(l)
+ WeakSequence.__iter__ = _random_iter
+
}}}
crazy failures. very weird that one isn't hitting in pypy.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2794#comment:3>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|