Commit Graph

114 Commits

Author SHA1 Message Date
Diana Clarke 40071dbda4 initializing _labels to an empty list so that the other methods don't throw exceptions in the None labels case, but rather return (), [], or {}. this is not backwards compatible, but doubt anyone is relying on those exceptions #2601 2012-11-17 15:28:50 -05:00
Diana Clarke dbdd0fdd48 adding _fields, _asdict() to KeyedTuple #2601 2012-11-17 14:55:26 -05:00
Diana Clarke e469529a1d adding tests for KeyedTuple, pep8 pass 2012-11-17 09:51:12 -05:00
Diana Clarke 8a4ab8a4db oops! python 3 doesn't do the rich comparison cmp thing 2012-11-14 23:25:09 -05:00
Diana Clarke f0e19297ee __sub__ was declared twice, just increasing test coverage before I change anything 2012-11-13 18:51:35 -05:00
Mike Bayer 20cdc64588 trying different approaches to test layout. in this one, the testing modules
become an externally usable package but still remains within the main sqlalchemy parent package.
in this system, we use kind of an ugly hack to get the noseplugin imported outside of the
"sqlalchemy" package, while still making it available within sqlalchemy for usage by
third party libraries.
2012-09-27 02:37:33 -04:00
Mike Bayer e5accce97b - repair bool() for instance level event listener where events are classlevel, continuing [ticket:2516] 2012-09-20 12:03:24 -04:00
Mike Bayer 28bfc3d5df - [feature] The before_cursor_execute event
fires off for so-called "_cursor_execute"
    events, which are usually special-case
   executions of primary-key bound sequences
    and default-generation SQL
    phrases that invoke separately when RETURNING
    is not used with INSERT.  [ticket:2459]
2012-08-23 15:40:09 -04:00
Mike Bayer 22ba1c43b7 -whitespace bonanza, contd 2012-07-28 17:05:50 -04:00
Mike Bayer ce9a702dbd - express most of the orm.util functions in terms of the inspection system
- modify inspection system:
	1. raise a new exception for any case where the inspection
        context can't be returned.  this supersedes the "not mapped"
        errors.
        2. don't configure mappers on a mapper inspection.  this allows
        the inspectors to be used during mapper config time.  instead,
        the mapper configures on "with_polymorphic_selectable" now,
        which is needed for all queries
- add a bunch of new "is_XYZ" attributes to inspectors
- finish making the name change of "compile" -> "configure", for some reason
this was only done partially
2012-07-16 17:29:02 -04:00
Mike Bayer c5f8241006 remove WeakIdentityMapping tests 2012-06-24 02:29:08 -04:00
Mike Bayer 4009894100 - [feature] Dramatic improvement in memory
usage of the event system; instance-level
collections are no longer created for a
particular type of event until
instance-level listeners are established
for that event.  [ticket:2516] Also in 0.7.9.
2012-06-20 18:55:13 -04:00
Mike Bayer 232dcbfb19 fix 2.5 failure 2012-04-24 19:55:43 -04:00
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