Commit Graph

73 Commits

Author SHA1 Message Date
Mike Bayer 3e6e61dbe7 - modernized cascade.py tests
- your cries have been heard:  removing a pending item
from an attribute or collection with delete-orphan
expunges the item from the session; no FlushError is raised.
Note that if you session.save()'ed the pending item
explicitly, the attribute/collection removal still knocks
it out.
2008-02-17 18:13:14 +00:00
Jason Kirtland 90e3532d0c - Made testlib's --unhashable and r3935's set changes play nice
- A bonus overhead reduction for IdentitySet instances
2008-02-14 22:39:42 +00:00
Mike Bayer c0b5a0446b - updated the naming scheme of the base test classes in test/testlib/testing.py;
tests extend from either TestBase or ORMTest, using additional mixins for
special assertion methods as needed
2008-02-11 00:28:39 +00:00
Mike Bayer 90c572b513 - Table columns and constraints can be overridden on a
an existing table (such as a table that was already
reflected) using the 'useexisting=True' flag, which now
takes into account the arguments passed along with it.
- fixed one element of [ticket:910]
- refactored reflection test
2008-02-10 23:39:09 +00:00
Mike Bayer 842934f40c - added generative where(<criterion>) method to delete()
and update() constructs which return a new object with
criterion joined to existing criterion via AND, just
like select().where().
- compile assertions use assertEquals()
2008-02-08 22:57:45 +00:00
Jason Kirtland b5dd96590a - Added a simple @future test marker. 2008-01-28 19:58:39 +00:00
Jason Kirtland 7ed5faff26 - Fixed little think-o in fails_if 2008-01-28 19:52:04 +00:00
Jason Kirtland 47a8b6d10d - Migrated zoomark to profiling.function_call_count(), tightened up the numbers. Is there variation by platform too? Buildbots will tell... 2008-01-22 22:43:04 +00:00
Jason Kirtland b3cc2f7e0c - 2.3 fixup part three: 100% on postgres, mysql 2008-01-22 21:08:21 +00:00
Jason Kirtland 412c80dd6c - 2.3 fixup, part two: 100% passing for sqlite
- added 2.4-style binops to util.Set on 2.3
  - OrderedSets pickle on 2.3
  - more lib/sqlalchemy set vs Set corrections
  - fixed InstrumentedSet.discard for 2.3
  - set, sorted compatibility for test suite
- added testing.fails_if decorator
2008-01-21 23:19:39 +00:00
Jason Kirtland 4be99db15b - Restored 2.3 compat. in lib/sqlalchemy
- Part one of test suite fixes to run on 2.3
  Lots of failures still around sets; sets.Set differs from __builtin__.set
  particularly in the binops. We depend on set extensively now and may need to
  provide a corrected sets.Set subclass on 2.3.
2008-01-19 23:37:11 +00:00
Jason Kirtland 21193cebe2 - Added source transformation framework for non-2.4 parser implementations
- test/clone.py can create and update (transformed) copies of the test suite
- Added Python 2.4 decorator -> 2.3 source transform
2008-01-19 23:11:47 +00:00
Jason Kirtland 17d3c8764e - testbase is gone, replaced by testenv
- Importing testenv has no side effects- explicit functions provide similar behavior to the old immediate behavior of testbase
- testing.db has the configured db
- Fixed up the perf/* scripts
2008-01-12 22:03:42 +00:00
Jason Kirtland c194962019 - Undeclared SAWarnings are now fatal to tests as well.
- Fixed typo that was killing runs of individual named tests.
2008-01-12 04:52:05 +00:00
Jason Kirtland bf36c648f2 Reworked r4042- undeclared deprecation warnings are now *fatal* to tests. No surprises. 2008-01-10 02:37:39 +00:00
Jason Kirtland 84576e3258 test suite deprecation rampage 2008-01-09 22:54:51 +00:00
Jason Kirtland 68a9e6cb1f Added 'function_call_count' assertion decorator. The full-suite vs. isolated run call count discrepancy needs to be ironed out before this can be applied to zoomark. 2008-01-05 21:56:22 +00:00
Mike Bayer b9b0aca757 - auto-reconnect support improved; a Connection can now automatically
reconnect after its underlying connection is invalidated, without
needing to connect() again from the engine.  This allows an ORM session
bound to a single Connection to not need a reconnect.
Open transactions on the Connection must be rolled back after an invalidation
of the underlying connection else an error is raised.  Also fixed
bug where disconnect detect was not being called for cursor(), rollback(),
or commit().
2007-12-19 19:51:46 +00:00
Lele Gaifax e7f30cba78 Fix the unpacking of the refered table name under Firebird
This fixes a little glitch introduced in [3959], in case of "implicit FKs"
(that is, {{{ForeignKey("orders")}}}, where the field(s) is missing).
2007-12-19 08:03:57 +00:00
Jason Kirtland 1dc4546aa9 Apply default cascade rules for firebird self-ref ForeignKeys. 2007-12-18 19:37:03 +00:00
Lele Gaifax 7c1e57879d Add Firebird to the list of DBs that needs explicit sequences 2007-12-18 13:03:55 +00:00
Lele Gaifax 8ce3f5d699 Fix bad example of Firebird test DB
Use an absolute path rather than a relative one, and the out-of-the-box
sysdba password. This is just to avoid confusing new testers, that should
add a db.firebird entry in their ~/satest.cfg anyway.
2007-12-16 10:59:06 +00:00
Jason Kirtland 8128a6378a - Removed @testing.supported. Dialects in development or maintained outside
the tree can now run the full suite of tests out of the box.
- Migrated most @supported to @fails_on, @fails_on_everything_but, or (last
  resort) @unsupported.  @fails_on revealed a slew of bogus test skippage,
  which was corrected.
- Added @fails_on_everything_but.  Yes, the first usage *was*
  "fails_on_everything_but('postgres')".  How did you guess!
- Migrated @supported in dialect/* to the new test-class attribute __only_on__.
- Test classes can also have __unsupported_on__ and __excluded_on__.
2007-12-13 09:59:14 +00:00
Mike Bayer 5c14b20f9f implemented many-to-one comparisons to None generate <column> IS NULL, with column on the left side in all cases 2007-12-12 17:56:52 +00:00
Mike Bayer f1ee3d406f - fix up the fixtures comparator
- strengthened memory profiling test
2007-12-09 15:56:37 +00:00
Mike Bayer 622a26a655 - session.refresh() and session.expire() now support an additional argument
"attribute_names", a list of individual attribute keynames to be refreshed
or expired, allowing partial reloads of attributes on an already-loaded
instance.
- finally simplified the behavior of deferred attributes, deferred polymorphic
load, session.refresh, session.expire, mapper._postfetch to all use a single
codepath through query._get(), which now supports a list of individual attribute names
to be refreshed.  the *one* exception still remaining is mapper._get_poly_select_loader(),
which may stay that way since its inline with an already processing load operation.
otherwise, query._get() is the single place that all "load this instance's row" operation
proceeds.
- cleanup all over the place
2007-11-18 02:13:56 +00:00
Mike Bayer 64b7a0cd6e modified last commit; the eager loader only undefers columns from the primary mapped table. 2007-11-14 16:59:49 +00:00
Mike Bayer 750439ac5f - fixed remainder of [ticket:853]
- bindparam 'shortname' is deprecated
- fixed testing.assert_compile() to actually generate bind param dict before asserting
- added bind param assertions to CRUDTest.test_update
2007-11-07 22:25:01 +00:00
Jason Kirtland d36a3940a0 Added testing.fails_on('db') failure-asserter. 2007-11-05 22:02:00 +00:00
Jason Kirtland ceb782ba49 More improvements to testlib's mapper decorator 2007-11-02 00:27:40 +00:00
Jason Kirtland 55c9b05cdb Tweaks for assert_unordered_result 2007-11-01 23:13:30 +00:00
Jason Kirtland c87295cdfd Added AssertMixin.assert_unordered_result 2007-11-01 20:59:30 +00:00
Jason Kirtland 1bf0aee385 Added rowset() testing helper. 2007-11-01 19:40:08 +00:00
Mike Bayer 66cd772094 - merged factor_down_bindparams branch.
- removed ClauseParameters object; compiled.params returns a regular dictionary
  now, as well as result.last_inserted_params()/last_updated_params().
- various code trimming, method removals.
2007-11-01 03:58:21 +00:00
Jason Kirtland ad9f8b8158 Added command line options to add tripwires for __hash__, __eq__ and __nonzero__ on mapped classes. 2007-10-31 23:49:09 +00:00
Mike Bayer 4a4daad81a - removed regular expression step from most statement compilations.
also fixes [ticket:833]
- inlining on PG with_returning() call
- extra options added for profiling
2007-10-27 17:41:30 +00:00
Jason Kirtland f64aac55cc A --db alias for max. 2007-10-24 07:55:18 +00:00
Jason Kirtland 21c6fa79b1 Fixed assert_sql_count exception logic. 2007-10-23 07:03:07 +00:00
Mike Bayer cb9321116f - removed __len__ from "dynamic" collection as it would require issuing
a SQL "count()" operation, thus forcing all list evaluations to issue
  redundant SQL [ticket:818]
2007-10-17 16:49:15 +00:00
Jason Kirtland 79dafdf3d4 Restored unicode foreign key tests for [ticket:729]. 2007-10-14 18:35:51 +00:00
Mike Bayer 0dde728591 - fixed three- and multi-level select and deferred inheritance
loading (i.e. abc inheritance with no select_table), [ticket:795]
2007-09-29 20:17:40 +00:00
Mike Bayer 4be3b2664d fixed firebird visit_alias [ticket:779] 2007-09-22 18:13:23 +00:00
Mike Bayer 6b0a907fbd - merged sa_entity branch. the big change here is the attributes system
deals primarily with the InstanceState and almost never with the instrumented object
directly.  This reduces lookups and complexity since we need the state for just about
everything, now its the one place for everything internally.
we also merged the new weak referencing identity map, which will go out in beta6 and
we'll see how that goes !
2007-09-22 16:55:36 +00:00
Mike Bayer 5800950add - took out method calls for oid_column
- reduced complexity of parameter handling during execution; __distill_params does all
parameter munging, executioncontext.parameters always holds a list of parameter structures
(lists, tuples, or dicts).
2007-09-04 18:07:16 +00:00
Mike Bayer 3126d464e7 - removed "parameters" argument from clauseelement.compile(), replaced with
"column_keys".  the parameters sent to execute() only interact with the
  insert/update statement compilation process in terms of the column names
  present but not the values for those columns.
  produces more consistent execute/executemany behavior, simplifies things a
  bit internally.
2007-09-04 00:08:57 +00:00
Jason Kirtland fba14f6047 from foo import (name, name) isn't valid syntax for 2.3. ah well.
omitting modules from sqlalchemy.__all__...
2007-08-21 22:20:52 +00:00
Mike Bayer b8e92e6692 added first profile tests per [ticket:753] 2007-08-21 19:15:55 +00:00
Paul Johnston 1b1da969eb mssql unit test fixes 2007-08-19 15:30:02 +00:00
Mike Bayer 7c6c1b99c2 1. Module layout. sql.py and related move into a package called "sql".
2. compiler names changed to be less verbose, unused classes removed.
3. Methods on Dialect which return compilers, schema generators, identifier preparers
have changed to direct class references, typically on the Dialect class itself
or optionally as attributes on an individual Dialect instance if conditional behavior is needed.
This takes away the need for Dialect subclasses to know how to instantiate these
objects, and also reduces method overhead by one call for each one.
4. as a result of 3., some internal signatures have changed for things like compiler() (now statement_compiler()), preparer(), etc., mostly in that the dialect needs to be passed explicitly as the first argument (since they are just class references now).  The compiler() method on Engine and Connection is now also named statement_compiler(), but as before does not take the dialect as an argument.

5. changed _process_row function on RowProxy to be a class reference, cuts out 50K method calls from insertspeed.py
2007-08-18 21:37:48 +00:00
Mike Bayer 95748cfc02 - added extra argument con_proxy to ConnectionListener interface checkout/checkin methods
- changed testing connection closer to work on _ConnectionFairy instances, resulting in
pool checkins, not actual closes
- disabled session two phase test for now, needs work
- added some two-phase support to TLEngine, not tested
- TLTransaction is now a wrapper
2007-08-17 17:59:08 +00:00