Commit Graph

101 Commits

Author SHA1 Message Date
Mike Bayer 54017d9de2 merge patch for [ticket:2208]. This still needs documentation. 2012-04-23 12:03:54 -04:00
Mike Bayer ff0fb31bf2 - merge attribute flag overhaul for [ticket:2358] 2012-04-23 11:45:06 -04:00
Mike Bayer f1bdd4e4bb begin implementing inspection system for #2208 2012-04-03 18:53:39 -04:00
Mike Bayer 8696a45b09 - [bug] Fixed event registration bug
which would primarily show up as
events not being registered with
sessionmaker() instances created
after the event was associated
with the Session class.  [ticket:2424]
2012-03-07 22:36:22 -05:00
Mike Bayer a8dc787ff0 - [feature] IdentitySet supports the - operator
as the same as difference(), handy when dealing
with Session.dirty etc. [ticket:2301]
2011-12-06 13:22:59 -05:00
Mike Bayer 127c48252e - Fixed bug in unit of work whereby detection of
"cycles" among classes in highly interlinked patterns
    would not produce a deterministic
    result; thereby sometimes missing some nodes that
    should be considered cycles and causing further
    issues down the road.  Note this bug is in 0.6
    also; not backported at the moment.
    [ticket:2282]
2011-09-22 19:21:39 -04:00
Mike Bayer 9b33b23a13 who knew we already had a test for that 2011-08-22 11:26:52 -04:00
Mike Bayer 3daae3e5b6 - Added an improved repr() to TypeEngine objects
that will only display constructor args which
are positional or kwargs that deviate
from the default.  [ticket:2209]
2011-07-04 13:56:17 -04:00
Mike Bayer 0b52a5ae74 - Added @event.listens_for() decorator, given
target + event name, applies the decorated
function as a listener.  [ticket:2106]
- remove usage of globals from test.base.test_events
2011-04-02 13:29:11 -04:00
Mike Bayer 7b24e458c7 - move all the comments that got shoved below the fixture grabs back up 2011-03-27 17:19:00 -04:00
Mike Bayer 68a350d462 - remove test.sql._base, test.engine._base, test.orm._base, move those classes to a new test.lib.fixtures module
- move testing.TestBase to test.lib.fixtures
- massive search and replace
2011-03-27 16:27:27 -04:00
Mike Bayer b1b8e7defd - alex gaynor's latest batch of pypy test fixes 2011-03-16 13:04:07 -04:00
Taavi Burns 1b812102a7 Removing unused symbol import 2011-03-15 16:01:58 -04:00
Mike Bayer a7f766d7c7 - establish an "insert" option for events to control ordering if needed (not needed yet tho)
- render foreign key constraints in the order in which they were cerated
2011-02-25 13:20:43 -05:00
Mike Bayer 7e8f351097 - Non-DBAPI errors which occur in the scope of an execute()
call are now wrapped in sqlalchemy.exc.StatementError,
and the text of the SQL statement and repr() of params
is included.  This makes it easier to identify statement
executions which fail before the DBAPI becomes
involved.  [ticket:2015]
2011-02-09 18:11:40 -05:00
Mike Bayer eee9b55f0c rename 'frozendict' to 'immutabledict', since 'frozen' implies hashability
like frozenset which isn't really the purpose of 'immutabledict' (could be someday,
in which case, we'd change the name back :) )
2011-01-20 13:32:59 -05:00
Mike Bayer 350aed3fdb - whitespace removal bonanza 2011-01-02 14:23:42 -05:00
Mike Bayer 426c4356eb - removes the "on_" prefix. 2010-12-30 14:22:43 -05:00
Mike Bayer ecf1571ba7 - factor out the dependency on the "on_" name 2010-12-30 14:07:15 -05:00
Mike Bayer 7f7bccfc83 - they don't want "on_". First step, change the naming convention on Events
so that non-events are just _name.
2010-12-30 13:43:39 -05:00
Mike Bayer f1e54a69fb - merge default tip 2010-12-05 14:56:26 -05:00
Mike Bayer 1f9029597c - move topological, queue into util
- move function_named into test.lib.util
- use @decorator for all decorators in test/
2010-12-05 12:51:24 -05:00
Mike Bayer d30678d18d new calling style: event.listen(target, identifier, fn) 2010-12-01 14:10:11 -05:00
Mike Bayer 58b2939433 - sqlalchemy.test and nose plugin moves back to being entirely
outside of "sqlalchemy" and under "test/".

Rationale:

- coverage plugin works without issue, without need for an awkward
additional package install
- command line for "nosetests" isn't polluted with SQLAlchemy options

[ticket:1949]
2010-11-28 14:19:44 -05:00
Mike Bayer 77f641429f - Fixed operator precedence rules for multiple
chains of a single non-associative operator.
I.e. "x - (y - z)" will compile as "x - (y - z)"
and not "x - y - z".  Also works with labels,
i.e. "x - (y - z).label('foo')"
[ticket:1984]
- Single element tuple expressions inside an IN clause
parenthesize correctly, also from [ticket:1984],
added tests for PG
- re-fix again importlater, [ticket:1983]
2010-11-25 12:20:13 -05:00
Mike Bayer e1402efb19 - move sqlalchemy.test to test.lib 2010-11-15 19:37:50 -05:00
Mike Bayer 13fedc23ec - 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
2010-11-07 12:49:48 -05:00
Mike Bayer 1f2423d23c - attempting system of propagation. getting stuck on attempting to use instance methods as listeners. 2010-11-06 17:34:54 -04:00
Mike Bayer d9dc05adb6 - begin adding tests for event registration and dispatch standalone
- fix pickling again
- other test fixes
2010-10-02 17:22:37 -04:00
Mike Bayer e9e221977b - CircularDependencyError now has .cycles and .edges
members, which are the set of elements involved in
one or more cycles, and the set of edges as 2-tuples.
[ticket:1890]
2010-09-29 02:11:38 -04:00
Mike Bayer ccafaab200 restore py2k directive that got whacked by python tidy 2010-07-13 20:40:58 -04:00
Mike Bayer f2b43da1a8 tidy test/base, test/ex, test/ext 2010-07-11 13:41:38 -04:00
Mike Bayer 0adf381d99 - Fixed @memoized_property and @memoized_instancemethod
decorators so that Sphinx documentation picks up
these attributes and methods, such as
ResultProxy.inserted_primary_key. [ticket:1830]
2010-06-19 14:08:20 -04:00
Mike Bayer cfe9fadc61 change the weakkeydict to be just an LRU cache. Add tests
for the "many combinations of UPDATE keys" issue.
2010-05-31 11:56:08 -04:00
Mike Bayer 74a417a599 dont use collections on 2.4 2010-04-14 18:38:11 -04:00
Mike Bayer 8ee0590270 breakthrough, wow 2010-04-05 18:48:57 -04:00
Mike Bayer 23a49e346b - further reduce what topological has to do, expects full list of nodes
- fix some side-effect-dependent behaviors in uow.  we can now
unconditionally remove "disabled" actions without rewriting
2010-04-04 12:24:01 -04:00
Mike Bayer 03fecba819 really got topological going. now that we aren't putting fricking mapped objects into
it all that id() stuff can go
2010-03-31 15:12:29 -04:00
Mike Bayer b9f1a92493 This is turning out to be a rewrite of the accounting system of unitofwork.py, but the overarching
method of doing things stays the same.   it should be easy to add new dependencies
between actions and to change the structure of how things are done.
2010-03-30 19:19:41 -04:00
Mike Bayer 62d6bf4cc3 start sketching ideas for a rewritten unit of work.
the basic idea is to bring topological back down to the raw function,
then the whole UOW constructs itself as very fine grained elements with
full dependencies to each other.  then a straight execute with a straight sort.
the hope is that the mechanism here would be vastly simpler.  while
the presence of a large number of fine-grained records may be expensive
it still is potentially a lot easier to distill into C code, as the
uow's structure now consists of data.
2010-03-19 16:59:52 -04:00
Chris Withers 165eda5733 a handy @classproperty decorator 2010-02-23 17:17:08 +00:00
Mike Bayer 154f5a9434 generalized "test all the picklers" iterator works cross platform 2010-02-22 16:35:35 +00:00
Michael Trier 8c0567ea83 Fixed cPickle problem in Python3. 2010-02-20 23:08:18 +00:00
Mike Bayer 0b185fc84f - make frozendict serializable
- serialize tests use HIGHEST_PROTOCOL
2010-01-28 22:47:25 +00:00
Mike Bayer e7241263aa python3k fixes 2009-08-09 20:50:46 +00:00
Mike Bayer 8fc5005dfe merge 0.6 series to trunk. 2009-08-06 21:11:27 +00:00
Mike Bayer 45cec095b4 - unit tests have been migrated from unittest to nose.
See README.unittests for information on how to run
the tests.  [ticket:970]
2009-06-10 21:18:24 +00:00
Mike Bayer c84dd331df slight cleanup i want in 0.5/0.6 2009-05-31 21:27:56 +00:00
Mike Bayer 853992649c more fixes to bound parameter exception reporting 2009-05-26 17:03:03 +00:00
Mike Bayer d6b9757778 - added unit test for exception formatting
- Deprecated the hardcoded TIMESTAMP function, which when
used as func.TIMESTAMP(value) would render "TIMESTAMP value".
This breaks on some platforms as Postgres doesn't allow
bind parameters to be used in this context.  The hard-coded
uppercase is also inappropriate and there's lots of other
PG casts that we'd need to support.  So instead, use
text constructs i.e. select(["timestamp '12/05/09'"]).
2009-05-26 01:00:46 +00:00