diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-04-15 00:13:48 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-04-15 00:13:48 -0400 |
commit | 1cf4a745d83acc51a562ca1d1289cf524fbee33c (patch) | |
tree | b7d175573b73938c1e01cd20fb291d86a60e69a6 /lib/sqlalchemy/test | |
parent | 74a417a5996f829f301853eeed363e5389226107 (diff) | |
download | sqlalchemy-1cf4a745d83acc51a562ca1d1289cf524fbee33c.tar.gz |
- beef up the --reversetop test option to embed RandomSet throughout the ORM
- with m2m we have to go back to the previous approach of having both sides of
the DP fire off, tracking each pair of objects. history may not be consistently present
in one side or the other
- this revealed a whole lot of issues with self-referential m2m, which are fixed
Diffstat (limited to 'lib/sqlalchemy/test')
-rw-r--r-- | lib/sqlalchemy/test/assertsql.py | 3 | ||||
-rw-r--r-- | lib/sqlalchemy/test/config.py | 13 | ||||
-rw-r--r-- | lib/sqlalchemy/test/noseplugin.py | 2 |
3 files changed, 6 insertions, 12 deletions
diff --git a/lib/sqlalchemy/test/assertsql.py b/lib/sqlalchemy/test/assertsql.py index d67de2355..81ef73a7c 100644 --- a/lib/sqlalchemy/test/assertsql.py +++ b/lib/sqlalchemy/test/assertsql.py @@ -173,7 +173,8 @@ class CompiledSQL(SQLMatchRule): self._result = equivalent if not self._result: self._errmsg = "Testing for compiled statement %r partial params %r, " \ - "received %r with params %r" % (self.statement, all_params, _received_statement, all_received) + "received %r with params %r" % \ + (self.statement, all_params, _received_statement, all_received) class CountStatements(AssertRule): diff --git a/lib/sqlalchemy/test/config.py b/lib/sqlalchemy/test/config.py index efbe00fef..7d528a04b 100644 --- a/lib/sqlalchemy/test/config.py +++ b/lib/sqlalchemy/test/config.py @@ -1,6 +1,5 @@ import optparse, os, sys, re, ConfigParser, time, warnings - # 2to3 import StringIO @@ -166,15 +165,9 @@ post_configure['table_options'] = _set_table_options def _reverse_topological(options, file_config): if options.reversetop: - from sqlalchemy.orm import unitofwork + from sqlalchemy.orm import unitofwork, session, mapper, dependency from sqlalchemy import topological - class RevQueueDepSort(topological.QueueDependencySorter): - def __init__(self, tuples, allitems): - self.tuples = list(tuples) - self.allitems = list(allitems) - self.tuples.reverse() - self.allitems.reverse() - topological.QueueDependencySorter = RevQueueDepSort - unitofwork.DependencySorter = RevQueueDepSort + from sqlalchemy.test.util import RandomSet + topological.set = unitofwork.set = session.set = mapper.set = dependency.set = RandomSet post_configure['topological'] = _reverse_topological diff --git a/lib/sqlalchemy/test/noseplugin.py b/lib/sqlalchemy/test/noseplugin.py index 5e8e21e8f..6a3106e69 100644 --- a/lib/sqlalchemy/test/noseplugin.py +++ b/lib/sqlalchemy/test/noseplugin.py @@ -51,7 +51,7 @@ class NoseSQLAlchemy(Plugin): callback=_engine_strategy, help="Engine strategy (plain or threadlocal, defaults to plain)") opt("--reversetop", action="store_true", dest="reversetop", default=False, - help="Reverse the collection ordering for topological sorts (helps " + help="Use a random-ordering set implementation in the ORM (helps " "reveal dependency issues)") opt("--unhashable", action="store_true", dest="unhashable", default=False, help="Disallow SQLAlchemy from performing a hash() on mapped test objects.") |