Commit Graph

65 Commits

Author SHA1 Message Date
Diana Clarke a122db80f2 most of the drizzle docs are copy/pasta, let's just point users to the mysql docs and enhance as questions arise
- see #2385
2012-04-02 21:20:16 -04:00
Mike Bayer 6c03a8ddd3 - add __table_cls__ option to declarative, not publicized yet, is for the moment
for the benefit of the test.lib.schema package.
- use test.lib.schema.Table for the table within test.lib.fixtures.DeclarativeMappedTest
- [bug] Removed the check for number of
rows affected when doing a multi-delete
against mapped objects.   If an ON DELETE
CASCADE exists between two rows, we can't
get an accurate rowcount from the DBAPI;
this particular count is not supported
on most DBAPIs in any case, MySQLdb
is the notable case where it is.
[ticket:2403]
2012-03-12 13:14:14 -07:00
Mike Bayer 0536c48daf - expand the check to determine if a selectable column is embedded
in the corresponding selectable to take into account clones
of the target column.  fixes [ticket:2419]
- have _make_proxy() copy out the _is_clone_of attribute on the
new column so that even more corresponding_column() checks
work as expected for cloned elements.
- add a new test fixture so that mapped tests can be specified
using declarative.
2012-02-29 17:47:59 -05:00
Mike Bayer d101c597f5 - [feature] Added support for the "isolation_level"
parameter to all MySQL dialects.  Thanks
to mu_mind for the patch here. [ticket:2394]
- add documentation examples for mysql, postgresql
- pep8ing
2012-02-12 18:07:41 -05:00
Mike Bayer c710f6cbf6 - add a context manager availble via Engine.begin()
- add a test suite for all the Engine/Connection/TLEngine transaction/begin
helpers/context managers
- update docs
2012-02-12 16:43:26 -05:00
Mike Bayer dbd46170fb mark this test as unsupported before 2.6, there's some unicode
issue I'm not exactly sure of what nature it is
2012-01-28 16:00:34 -05:00
Mike Bayer 09553dc90f - [feature] Dialect-specific compilers now raise
CompileException for all type/statement compilation
issues, instead of InvalidRequestError or ArgumentError.
The DDL for CREATE TABLE will re-raise
CompileExceptions to include table/column information
for the problematic column.  [ticket:2361]
2012-01-28 15:20:21 -05:00
Mike Bayer 4480eea622 - [bug] Raise an exception if xyzload_all() is
used inappropriately with two non-connected
relationships.  [ticket:2370]
2012-01-28 13:33:05 -05:00
Mike Bayer f9c2f85a3a - [bug] Fixed issue where modified session state
established after a failed flush would be committed
as part of the subsequent transaction that
begins automatically after manual call
to rollback().   The state of the session is
checked within rollback(), and if new state
is present, a warning is emitted and
restore_snapshot() is called a second time,
discarding those changes. [ticket:2389]

- repaired testing.assert_warnings to also verify
that any warnings were emitted
2012-01-27 20:32:52 -05:00
Mike Bayer c9a1e570ad - rework the test suite to make use of SkipTest for tests skipped, unsupported, etc.
so that we can get an accurate picture what's really running/not, what's installed on jenkins, etc.
Tested in cpython 2.7 so far, we'll see what jenkins says about other platforms
2012-01-22 13:19:22 -05:00
Mike Bayer 5c86d3914c - [bug] Fixed inappropriate usage of util.py3k
flag and renamed it to util.py3k_warning, since
this flag is intended to detect the -3 flag
series of import restrictions only.
[ticket:2348]
2011-12-15 10:31:55 -05:00
Mike Bayer 58e692d76b - enable SAVEPOINT support fully, remove warning, [ticket:822].
It's not known what the potential "data loss" issues are, tests seem to pass.
2011-12-06 17:41:19 -05:00
Mike Bayer 0c3a53d433 sort of muscling this out, mysql a PITA 2011-11-21 20:40:31 -05:00
Mike Bayer e6a5ea8fa7 - [bug] Postgresql dialect memoizes that an ENUM of a
particular name was processed
during a create/drop sequence.  This allows
a create/drop sequence to work without any
calls to "checkfirst", and also means with
"checkfirst" turned on it only needs to
check for the ENUM once.  [ticket:2311]
2011-10-29 17:38:56 -04:00
Mike Bayer 0c6f6e2b77 fix this test for oursql 2011-10-15 15:22:21 -04:00
Mike Bayer f1eea63468 - Added an exception catch + warning for the
"return unicode detection" step within connect,
allows databases that crash on NVARCHAR to
continue initializing, assuming no NVARCHAR
type implemented.  [ticket:2299]
2011-10-15 12:10:31 -04:00
Mike Bayer 4f1321c3e9 - Enhanced the instrumentation in the ORM to support
Py3K's new argument style of "required kw arguments",
    i.e. fn(a, b, *, c, d), fn(a, b, *args, c, d).
    Argument signatures of mapped object's __init__
    method will be preserved, including required kw rules.
    [ticket:2237]
2011-09-28 13:04:42 -04:00
Mike Bayer c0f9221160 - Some unit test fixes regarding numeric arrays,
MATCH operator.   A potential floating-point
inaccuracy issue was fixed, and certain tests
of the MATCH operator only execute within an
EN-oriented locale for now.  [ticket:2175].
Also in 0.6.8.
2011-06-04 20:20:28 -04:00
Mike Bayer 16073ae044 - adjust further for unix-style casing, also this is mysql not just mysqldb 2011-06-02 20:11:47 -04:00
Mike Bayer 9211ecb6cf - Unit tests pass 100% on MySQL installed
on windows, after aggressive exclusion of a wide variety
of tests.   Not clear to what degree the failures are related to
version 5.5 vs. the usage of windows, in particular the ON UPDATE CASCADE
immediately crashes the server.   The features being tested here are all
edge cases not likely to be used in typical MySQL environments.
- Removed the "adjust casing" step that would
fail when reflecting a table on MySQL
on windows with a mixed case name.  After some
experimenting with a windows MySQL server, it's
been determined that this step wasn't really
helping the situation much; MySQL does not return
FK names with proper casing on non-windows
platforms either, and removing the step at
least allows the reflection to act more like
it does on other OSes.   A warning here
has been considered but its difficult to
determine under what conditions such a warning
can be raised, so punted on that for now -
added some docs instead. [ticket:2181]

- supports_sane_rowcount will be set to False
if using MySQLdb and the DBAPI doesn't provide
the constants.CLIENT module.
2011-06-02 19:52:26 -04:00
Mike Bayer ca3ef312d2 - make sure we definitely get every connection created
- ensure we lose self.conns, cx_oracle only closes on __del__
- fix reconnectingfixture to lose all connection references
2011-05-14 13:34:29 -04:00
Mike Bayer 94ee7170b5 - query.count() emits "count(*)" instead of
"count(1)".  [ticket:2162]
- another test that should be excluded from "low-connections"
2011-05-10 15:45:37 -04:00
Mike Bayer 4d99799ee7 - given that Oracle's issue is not just open connections, but *closed* ones too, go really
heavy handed and start marking tests as "requires.ad_hoc_engines", add a flag --low-connections
that will switch the engine reaper mechanism to use as *few* distinct engines and connections
as possible, many engine tests that really need their own engines are just skipped.
2011-05-09 20:40:33 -04:00
Mike Bayer 53e584bc46 comment out the rollback on after test since pg8000 can deadlock on this (and its clear why).
but then what about the pypy jython team.  ho hum.
2011-04-30 15:38:27 -04:00
Mike Bayer 1092fd6590 uurg, add a use_reaper argument and have zoomark skip the reaping for its very special mode of operation... 2011-04-25 22:29:59 -04:00
Mike Bayer e1ec36fc9e - hardcore force every connection into a strong-referenced set, rollback on every test, close on every context.
this uses pool events but bypasses the pool's fairy/record/dispose services.   pypy still seems to expose
some holes in that at least as far as what some (or maybe just one, cant find it yet) of the tests does.
haven't tested this too deeply, just on sqlite + postgres, cypthon 2.7 + pypy.   will see what the buildbot
says
2011-04-25 21:50:26 -04:00
Mike Bayer 46ee78431c mark all aaa_profiling tests with __requires__ = 'cpython', 2011-04-23 12:34:38 -07:00
Mike Bayer 02fa8bacaa - added Query.with_session() method, switches
Query to use a different session.

- horizontal shard query should use execution
options per connection as per [ticket:2131]
2011-04-23 18:38:01 -04:00
Mike Bayer f8a7045f89 try a between here since 'in' looks for exact matches, doesn't work
with extra thingies in the version
2011-04-15 20:55:15 -04:00
Mike Bayer a347c03907 - no encoding with arrays
- rework the "builtin types" thing with the ReplayableSession to be py3k compatible
2011-04-08 15:59:28 -04:00
Mike Bayer da938820ec - fix a callcount
- remove extra _load_fixtures() method.   using the classbound version as the fixtures
seem to have everything classlevel at the moment (wondering if we want to change that
for non-classlevel setup/teardown)
2011-03-27 18:16:40 -04:00
Mike Bayer 54563de4bb - reorganizing the test modules and fixtures, but keeping the essential method of
creating fixture classes the same, i.e. run a method, then inspect __subclasses__() of
a marked base class, seems to have broken that approach permanently.   While the tests run
locally just fine, on the buildbot most of the environments continue to fail in entirely
random places.   One of the key changes of the reorganization is that the big bunch of
classes from _fixtures.py is now created ad-hoc instead of reusing a set of module-bound
classes.  This means there's a lot more class creation/teardown traffic occuring in the
cPython interpreter.   Taking a look at the docs for __subclasses__() confirms that the
list of subclasses is of course a weak-referenced collection.   So in the absense of the
tests working just fine for a couple of years, it would seem obvious that the bug
here is setup_classes()/mappers() is called, we come back, the new classes are now
not referenced at all, we then call __subclasses__() and maybe we get them, maybe we don't.
But it's totally not clear how this behavior just hasn't occurred at all for a couple
of years (except, possibly, for very rare occasions that I cannot reproduce).   So in this changeset we switch
to a method of class tracking that I use in a lot of other places, that of using a metaclass
to positively stick classes in the registry the moment they are created.   Test classes
are already built against a base that is created per-fixture run so we already have the advantage
of a local system.   I send this changeset to the buildbot and beg of it to please allow our
tests to pass once again !
2011-03-27 17:52:30 -04:00
Mike Bayer 89952f6b91 - dont clear the classes collection here either... 2011-03-27 17:28:41 -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 ebd0fdad73 - convert @provide_metadata to use self access
- having occasional issues with BasicEntity grabbing, if it persists
may have to pass an explicit base class into setup_classes()/setup_mappers()
2011-03-26 21:40:05 -04:00
Mike Bayer e3dbb87d94 - move _fixtures to work via the normal methods of _base.MappedTest, convert
all referncing tests to not use globals
- tests that deal with pickle specifically load the fixture classes
from test.lib.pickleable, which gets some more classes added
- removed weird sa05 pickling tests that don't matter
2011-03-26 20:44:47 -04:00
Mike Bayer 14a2fae239 - remove @testing.resolve_artifact_names, replace with direct attribute
access to the cls/self.tables/classes registries
- express orm/_base.py ORMTest in terms of engine/_base.py TablesTest,
factor out common steps into TablesTest, remove AltEngineTest as a
separate class.   will further consolidate these base classes
2011-03-26 19:03:11 -04:00
Alex Gaynor 0cf1a29b72 this test fails on PyPy because it checks for a lastrowid after the connection is lcosed 2011-03-16 14:18:27 -04:00
Mike Bayer b334fa458b - adjust gc_collect for pypy 2011-03-15 22:11:34 -04:00
Michael Trier a1288bf78f Modifications for PyPy support from Alex Gaynor. 2011-03-08 23:40:59 -05:00
Mike Bayer 33eae4a140 make it more explicit in tests which dialect we want to use for things 2011-02-11 11:24:54 -05:00
Mike Bayer 020d6ef8f0 - Added over() function, method to FunctionElement
classes, produces the _Over() construct which
in turn generates "window functions", i.e.
"<window function> OVER (PARTITION BY <partition by>,
ORDER BY <order by>)".
[ticket:1844]
2011-02-10 21:57:44 -05:00
Mike Bayer e43f85965e - The path given as the location of a sqlite database is now
normalized via os.path.abspath(), so that directory changes
within the process don't affect the ultimate location
of a relative file path.  [ticket:2036]
2011-02-10 15:03:11 -05:00
Mike Bayer 3f30fb065c - The compiler extension now supports overriding the default
compilation of expression._BindParamClause including that
the auto-generated binds within the VALUES/SET clause
of an insert()/update() statement will also use the new
compilation rules. [ticket:2042]
2011-02-09 15:45:15 -05:00
Mike Bayer 54cc2aa18c - schema.copy() functions will copy dispatch, but only for those events
added with propagate=True.   needs tests
- oracle/fb test schema uses event w/ propagate=True to apply
Sequence to primary key columns with test_needs_autoincrement.
this does actually test the propagate=True flag a bit since it's
needed in the declarative mixin tests where the 'id' column
is copied.
2011-02-01 09:26:36 -05:00
Mike Bayer 1515073b96 - New DBAPI support for pymysql, a pure Python port
of MySQL-python.  [ticket:1991]
2011-01-26 11:18:03 -05:00
Mike Bayer 9122268ed0 - new dialect for Drizzle [ticket:2003]
- move mysqldb to a connector, can be shared among mysql/drizzle
2011-01-26 10:44:00 -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 aa62a3a833 - factor consistent set_isolation_level(), get_isolation_level()
per-connection methods for sqlite, postgresql, psycopg2 dialects
- move isolation test suite to test engines/test_transaction
- preparing for [ticket:2001]
2011-01-16 13:05:18 -05:00
Mike Bayer 67e0f356b2 - A TypeDecorator of Integer can be used with a primary key
column, and the "autoincrement" feature of various dialects
  as well as the "sqlite_autoincrement" flag will honor
  the underlying database type as being Integer-based.
 [ticket:2005]

- Result-row processors are applied to pre-executed SQL
  defaults, as well as cursor.lastrowid, when determining
  the contents of result.inserted_primary_key.
  [ticket:2006]

- Bind parameters present in the "columns clause" of a select
  are now auto-labeled like other "anonymous" clauses,
  which among other things allows their "type" to be meaningful
  when the row is fetched, as in result row processors.

- TypeDecorator is present in the "sqlalchemy" import space.
2011-01-11 15:22:46 -05:00