Commit Graph

152 Commits

Author SHA1 Message Date
Mike Bayer 76e127450c - allow 10 stray connections that need a gc
- be specific as to what occurred when we collect stray gc
2014-07-22 12:55:17 -04:00
Brian Jarrett cca03097f4 - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,
sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
2014-07-20 12:44:40 -04:00
Mike Bayer 5407ec9d38 - break up the <authors> copyright comment as part of a pass
to get all flake8 passing
2014-07-09 18:26:55 -04:00
Mike Bayer bbb81e682c - support __only_on__ and __backend__ at the same time 2014-07-09 18:12:32 -04:00
Mike Bayer 99350b159f - Fixed bug where "python setup.py test" wasn't calling into
distutils appropriately, and errors would be emitted at the end
of the test suite.
2014-07-09 15:50:17 -04:00
Mike Bayer 7e7447db1f - Reverted the change for 🎫3060 - this is a unit of work
fix that is updated more comprehensively in 1.0 via 🎫`3061`.
The fix in 🎫`3060` unfortunately produces a new issue whereby
an eager load of a many-to-one attribute can produce an event
that is interpreted into an attribute change.
2014-06-23 18:42:54 -04:00
Mike Bayer 46abb87ef4 Merge branch 'master' of https://github.com/BY-jk/sqlalchemy 2014-06-08 17:52:51 -04:00
BY-jk 39bea64bc3 Wrong type usage
Wrong Type (TEXT) being used in StringTest
2014-05-30 15:18:02 +02:00
Mike Bayer 2c8689fd14 - add a new assertsql construct "Or", so that we can test for a UOW flush
that might take one of multiple directions; apply this to test_delete_unloaded_m2o
which is now illustrating multiple paths due to #3060/#3061, though still doing the
right thing.
2014-05-30 00:21:11 -04:00
Mike Bayer 81959af6d3 - more tests, including backend tests
- implement for SQL server, use window functions when simple limit/offset not available
2014-05-16 15:33:39 -04:00
Matthias Urlichs f341cfbfe1 Documentation fix-up: "its" vs. "it's"
Removed ungrammatical apostrophes from documentation, replacing
"it's" with "its" where appropriate (but in a few cases with "it is"
when that read better).

While doing that, I also fixed a couple of minor typos etc.
as I noticed them.
2014-05-11 16:49:56 +02:00
Alex Gaynor 1caa7fafbd Fix many typos throughout the codebase
Found using: https://github.com/intgr/topy
2014-04-26 13:13:13 -07:00
Matt Chisholm c887d62810 use importlib.machinery to load modules instead of imp under Python 3.3 and greater
part of #2830
2014-04-14 13:58:39 -04:00
Mike Bayer c01558ae7f - Fixed ORM bug where changing the primary key of an object, then marking
it for DELETE would fail to target the correct row for DELETE.
Then to compound matters, basic "number of rows matched" checks were
not being performed.  Both issues are fixed, however note that the
"rows matched" check requires so-called "sane multi-row count"
functionality; the DBAPI's executemany() method must count up the
rows matched by individual statements and SQLAlchemy's dialect must
mark this feature as supported, currently applies to some mysql dialects,
psycopg2, sqlite only. fixes #3006
- Enabled "sane multi-row count" checking for the psycopg2 DBAPI, as
this seems to be supported as of psycopg2 2.0.9.
2014-03-28 16:32:11 -04:00
Mike Bayer 50576a01eb - Tweaked the settings for mysql-connector-python; in Py2K, the
"supports unicode statements" flag is now False, so that SQLAlchemy
will encode the *SQL string* (note: *not* the parameters)
to bytes before sending to the database.  This seems to allow
all unicode-related tests to pass for mysql-connector, including those
that use non-ascii table/column names, as well as some tests for the
TEXT type using unicode under cursor.executemany().
- other mysql-connector fixes; latest version seems to do better on
function call counts
2014-03-27 19:18:06 -04:00
Stefan Reich 460139f630 Added missing text_type requirement to TextTest
Conflicts:
	lib/sqlalchemy/testing/suite/test_types.py
2014-03-27 18:28:28 -04:00
Mike Bayer e3a1a2d01c - fixes to multi-backend tests
- move the logic to determine "test id" into plugin_base
- update callcounts
2014-03-27 13:17:20 -04:00
Mike Bayer b6411ee3cf fixes to get profiling tests working again 2014-03-26 20:43:20 -04:00
Mike Bayer bd86942b05 dont warn, that just crashes the test... 2014-03-26 19:15:49 -04:00
Mike Bayer 99d07abe17 try to liberalize the pool._refs assertion a bit 2014-03-26 16:52:04 -04:00
Mike Bayer 4100f9c06e - remove nose dependency 2014-03-26 14:42:51 -04:00
Mike Bayer 12c8a10b81 fix 2014-03-24 13:33:53 -04:00
Mike Bayer 50d19f55d2 - add some more rules to make sure all tests run if DBs are available 2014-03-24 12:49:22 -04:00
Mike Bayer 2f150bee28 - rename __multiple__ to __backend__, and apply __backend__ to a large number of tests.
- move out logging tests from test_execute to test_logging
2014-03-24 11:33:53 -04:00
Mike Bayer 11003828cb - Added support for literal rendering of boolean values, e.g.
"true" / "false" or "1" / "0".
- added Boolean tests to the test suite
2014-03-13 20:03:48 -04:00
Mike Bayer 9c5c12fb23 - move some requirements up to the testing module to better support running
SQLA internal tests outside; plus things like savepoints, twophase
2014-03-13 19:59:10 -04:00
Mike Bayer 2057b86b2a comment 2014-03-13 19:18:58 -04:00
Mike Bayer dd40c63885 - add a suite test for underscore as initial char 2014-03-13 19:05:22 -04:00
Mike Bayer 8433a48fab - add more support for suite tests, moving some tests from test_query out to suite
and adding some more requirements
2014-03-13 18:54:56 -04:00
Mike Bayer 66338e33bf unitttest has a SkipTest also but pytest doesn't
honor it unless nose is imported too...
2014-03-11 18:06:20 -04:00
Mike Bayer 63bb4ec5ab import testing needs to be here as we set .db on it 2014-03-07 17:26:57 -05:00
Mike Bayer a4e84a154c - cx_oracle test for "unicode returns" needs to be cx_oracle only,
and also will fail on py3k.
- enhance exclusions so that a requirement attribute can be passed
to fails_if/skip_if.
- fix coverage docs to mention pytest.
2014-03-06 11:57:54 -05:00
Mike Bayer 81783a6241 - no unitest.SkipTest in 2.6...arggggg 2014-03-04 12:58:14 -05:00
Mike Bayer 2469b651e6 fix the profiling ids here 2014-03-03 18:43:28 -05:00
Mike Bayer ea05a23218 - Support has been added for pytest to run tests. This runner
is currently being supported in addition to nose, and will likely
be preferred to nose going forward.   The nose plugin system used
by SQLAlchemy has been split out so that it works under pytest as
well.  There are no plans to drop support for nose at the moment
and we hope that the test suite itself can continue to remain as
agnostic of testing platform as possible.  See the file
README.unittests.rst for updated information on running tests
with pytest.

The test plugin system has also been enhanced to support running
tests against mutiple database URLs at once, by specifying the ``--db``
and/or ``--dburi`` flags multiple times.  This does not run the entire test
suite for each database, but instead allows test cases that are specific
to certain backends make use of that backend as the test is run.
When using pytest as the test runner, the system will also run
specific test suites multiple times, once for each database, particularly
those tests within the "dialect suite".   The plan is that the enhanced
system will also be used by Alembic, and allow Alembic to run
migration operation tests against multiple backends in one run, including
third-party backends not included within Alembic itself.
Third party dialects and extensions are also encouraged to standardize
on SQLAlchemy's test suite as a basis; see the file README.dialects.rst
for background on building out from SQLAlchemy's test platform.
2014-03-03 15:55:17 -05:00
Mike Bayer fa23570a33 - add new tests for individual type reflection 2014-03-01 13:55:30 -05:00
Mike Bayer e99e38a3ff use view_column requirement here 2014-02-28 18:57:39 -05:00
Mike Bayer 43f95d3e5e - dont create a self-ref FK if test suite marked as not supporting self ref
- break out reflection of views to support view column reflection separately
from view definition
2014-02-28 18:50:18 -05:00
Mike Bayer 00c6ebb440 - rewrite SQLite reflection tests into one consistent fixture, which tests
both _resolve_type_affinity() directly as well as round trip tests fully.
2014-02-16 18:14:10 -05:00
Mike Bayer 4a79bc578c - Fixed bug where :class:.AbstractConcreteBase would fail to be
fully usable within declarative relationship configuration, as its
string classname would not be available in the registry of classnames
at mapper configuration time.   The class now explicitly adds itself
to the class regsitry, and additionally both :class:`.AbstractConcreteBase`
as well as :class:`.ConcreteBase` set themselves up *before* mappers
are configured within the :func:`.configure_mappers` setup, using
the new :meth:`.MapperEvents.before_configured` event. [ticket:2950]

- Added new :meth:`.MapperEvents.before_configured` event which allows
an event at the start of :func:`.configure_mappers`, as well
as ``__declare_first__()`` hook within declarative to complement
``__declare_last__()``.

- modified how after_configured is invoked; we just make a dispatch()
not actually connected to any mapper.  this makes it easier
to also invoke before_configured correctly.

- improved the ComparableEntity fixture to handle collections that are sets.
2014-02-11 19:55:34 -05:00
Mike Bayer 5b0919f3f5 - Added a new feature which allows automated naming conventions to be
applied to :class:`.Constraint` and :class:`.Index` objects.  Based
on a recipe in the wiki, the new feature uses schema-events to set up
names as various schema objects are associated with each other.  The
events then expose a configuration system through a new argument
:paramref:`.MetaData.naming_convention`.  This system allows production
of both simple and custom naming schemes for constraints and indexes
on a per-:class:`.MetaData` basis.  [ticket:2923]

commit 7e65e52c086652de3dd3303c723f98f09af54db8
Author: Mike Bayer <mike_mp@zzzcomputing.com>
Date:   Sat Feb 1 15:09:04 2014 -0500

    - first pass at new naming approach
2014-02-01 18:21:04 -05:00
Mike Bayer 32a1db3685 add a skip for oracle on this 2014-02-01 13:22:43 -05:00
Mike Bayer d8d03011b8 - repair the fixture/test here to make sure state isn't left over causing other tests to fail 2014-01-27 13:34:33 -05:00
Mike Bayer 44cba66cb2 - repair signature for base get_unique_constraints() method
- test_autoincrement_col still needs reflection overall
2014-01-20 16:09:40 -05:00
Mike Bayer 52b25c5319 - _cursor_execute() will close the cursor on error; oracle doesn't allow double close
- ensure no iterator changed size issues in testing.engines
2014-01-13 21:20:54 -05:00
Mike Bayer bebf30e34d - continue with [ticket:2907] and further clean up how we set up
_reset_agent, so that it's local to the various begin_impl(),
rollback_impl(), etc.  this allows setting/resetting of the flag
to be symmetric.
- don't set _reset_agent if it's not None, don't unset it if it isn't
our own transaction.
- make sure we clean it out in close().
- basically, we're dealing here with pools using "threadlocal" that have a
counter, other various mismatches that the tests bring up
- test for recover() now has to invalidate() the previous connection,
because closing it actually rolls it back (e.g. this test was relying
on the broken behavior).
2014-01-13 03:22:11 -05:00
Mike Bayer 1d4f0df35d - fix some function mismatch in profiling 2014-01-09 23:20:00 -05:00
Mike Bayer f89d4d216b - happy new year 2014-01-05 16:57:05 -05:00
Mike Bayer 4b923d37bd - support addition of fails_if()/only_on(), just wraps the decorators
- update a few exclusions to support current pymssql.  passes all of test_suite and dialect/mssql
2014-01-02 14:23:14 -05:00
Mike Bayer 1eb92e50d9 - apply a similar fix for floats to mssql+pyodbc as we did to firebird
- wrangle through osx+pyodbc+freetds to get at least test_suite to pass again
with mssql+pyodbc. invovled adding some silly requirements
2013-12-28 17:50:19 -05:00