summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing
Commit message (Collapse)AuthorAgeFilesLines
* - add a new qualifier "native" vs. "dbapi" unicode to avoidMike Bayer2016-01-241-0/+5
| | | | | | profiling problems here - add extras_require to setup.py for the most common DBAPIs - rework tox.ini to use extras, specify a test matrix built in
* - use uuid fragments for provision names to enable multiple test suitesMike Bayer2016-01-231-2/+2
| | | | per server
* - calling str() on a core sql construct has been made more "friendly",Mike Bayer2016-01-191-1/+1
| | | | | | | | | | when the construct contains non-standard sql elements such as returning, array index operations, or dialect-specific or custom datatypes. a string is now returned in these cases rendering an approximation of the construct (typically the postgresql-style version of it) rather than raising an error. fixes #3631 - add within_group to top-level imports - add eq_ignore_whitespace to sqlalchemy.testing imports
* - The ``str()`` call for :class:`.Query` will now take into accountMike Bayer2016-01-191-0/+9
| | | | | | | | | | | | the :class:`.Engine` to which the :class:`.Session` is bound, when generating the string form of the SQL, so that the actual SQL that would be emitted to the database is shown, if possible. Previously, only the engine associated with the :class:`.MetaData` to which the mappings are associated would be used, if present. If no bind can be located either on the :class:`.Session` or on the :class:`.MetaData` to which the mappings are associated, then the "default" dialect is used to render the SQL, as was the case previously. fixes #3081
* - reorganize schema_translate_map to be succinct and gain the performanceMike Bayer2016-01-111-2/+2
| | | | back by using an attrgetter for the default case
* - Multi-tenancy schema translation for :class:`.Table` objects is added.Mike Bayer2016-01-082-3/+12
| | | | | | | | | This supports the use case of an application that uses the same set of :class:`.Table` objects in many schemas, such as schema-per-user. A new execution option :paramref:`.Connection.execution_options.schema_translate_map` is added. fixes #2685 - latest tox doesn't like the {posargs} in the profile rerunner
* - pg8000 fixes for jsonMike Bayer2016-01-072-0/+8
|
* - add limiting criteria to the JSON tests so that we don'tMike Bayer2016-01-061-3/+16
| | | | | | attempt integer indexed access from a key/value object nor string access from an integer-indexed array, as earlier Postgresql versions (prior to 9.4) don't allow this
* - Added :class:`.mysql.JSON` for MySQL 5.7. The JSON type providesMike Bayer2016-01-062-2/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | persistence of JSON values in MySQL as well as basic operator support of "getitem" and "getpath", making use of the ``JSON_EXTRACT`` function in order to refer to individual paths in a JSON structure. fixes #3547 - Added a new type to core :class:`.types.JSON`. This is the base of the PostgreSQL :class:`.postgresql.JSON` type as well as that of the new :class:`.mysql.JSON` type, so that a PG/MySQL-agnostic JSON column may be used. The type features basic index and path searching support. fixes #3619 - reorganization of migration docs etc. to try to refer both to the fixes to JSON that helps Postgresql while at the same time indicating these are new features of the new base JSON type. - a rework of the Array/Indexable system some more, moving things that are specific to Array out of Indexable. - new operators for JSON indexing added to core so that these can be compiled by the PG and MySQL dialects individually - rename sqltypes.Array to sqltypes.ARRAY - as there is no generic Array implementation, this is an uppercase type for now, consistent with the new sqltypes.JSON type that is also not a generic implementation. There may need to be some convention change to handle the case of datatypes that aren't generic, rely upon DB-native implementations, but aren't necessarily all named the same thing.
* - Fixed bug in :meth:`.Update.return_defaults` which would cause allMike Bayer2015-12-141-3/+14
| | | | | | | | | | | | | | insert-default holding columns not otherwise included in the SET clause (such as primary key cols) to get rendered into the RETURNING even though this is an UPDATE. - Major fixes to the :paramref:`.Mapper.eager_defaults` flag, this flag would not be honored correctly in the case that multiple UPDATE statements were to be emitted, either as part of a flush or a bulk update operation. Additionally, RETURNING would be emitted unnecessarily within update statements. fixes #3609
* - Fixed bug where use of the :meth:`.Query.select_from` method wouldMike Bayer2015-12-121-2/+2
| | | | | | cause a subsequent call to the :meth:`.Query.with_parent` method to fail. fixes #3606 - add mark-as-fail test for #3607
* Merge remote-tracking branch 'origin/pr/210'Mike Bayer2015-11-301-1/+2
|\
| * Update usages of getargspec to compat version.pr/210Jacob MacDonald2015-10-291-1/+2
| | | | | | | | | | The places inspect.getargspec was being used were causing problems for newer Python versions.
* | - support declarativemappedtest with per-test setupMike Bayer2015-11-251-0/+10
| |
* | - A rare case which occurs when a :meth:`.Session.rollback` fails in theMike Bayer2015-11-191-1/+1
|/ | | | | | | | | | | | scope of a :meth:`.Session.flush` operation that's raising an exception, as has been observed in some MySQL SAVEPOINT cases, prevents the original database exception from being observed when it was emitted during flush, but only on Py2K because Py2K does not support exception chaining; on Py3K the originating exception is chained. As a workaround, a warning is emitted in this specific case showing at least the string message of the original database error before we proceed to raise the rollback-originating exception. fixes #2696
* - The system by which a :class:`.Column` considers itself to be anMike Bayer2015-10-071-1/+4
| | | | | | | | | | | | | | | | | "auto increment" column has been changed, such that autoincrement is no longer implicitly enabled for a :class:`.Table` that has a composite primary key. In order to accommodate being able to enable autoincrement for a composite PK member column while at the same time maintaining SQLAlchemy's long standing behavior of enabling implicit autoincrement for a single integer primary key, a third state has been added to the :paramref:`.Column.autoincrement` parameter ``"auto"``, which is now the default. fixes #3216 - The MySQL dialect no longer generates an extra "KEY" directive when generating CREATE TABLE DDL for a table using InnoDB with a composite primary key with AUTO_INCREMENT on a column that isn't the first column; to overcome InnoDB's limitation here, the PRIMARY KEY constraint is now generated with the AUTO_INCREMENT column placed first in the list of columns.
* - bzzt, fix the base _post_configure_engine() call to not failMike Bayer2015-09-291-1/+1
|
* - limit the search for schemas to not include "temp", which is sort of an ↵Mike Bayer2015-09-281-3/+28
| | | | | | | | | | implicit schema - repair the CREATE INDEX ddl for schemas - update provisioning to include support for setting up ATTACH DATABASE up front for the test_schema; enable "schemas" testing for SQLite - changelog / migration notes for new SQLite schema support - include the "schema" as the "remote_schema" when we reflect SQLite FKs
* - fix the postgresql_jsonb requirement to include the 9.4 requirementMike Bayer2015-08-181-3/+3
| | | | | | | | - new test for json col['x']['y']['z'] seems to fail pre PG 9.4, fails on comparisons for non-compatible data instead of not matching - no need to call SpecPredicate(db) directly in exclusion functions, by using Predicate.as_predicate() the spec strings can have version comparisons
* - make these failure cases more specific to catch Oracle.Mike Bayer2015-08-152-5/+20
| | | | Would be nice to fix Oracle here
* - The behavior of the :func:`.union` construct and related constructsMike Bayer2015-08-122-2/+133
| | | | | | | | | such as :meth:`.Query.union` now handle the case where the embedded SELECT statements need to be parenthesized due to the fact that they include LIMIT, OFFSET and/or ORDER BY. These queries **do not work on SQLite**, and will fail on that backend as they did before, but should now work on all other backends. fixes #2528
* - remove "distutils-only" mode, use setuptools onlyMike Bayer2015-07-241-11/+0
| | | | | | - add first-class "pytest" runner to setup.py, fixes #3489 - remove references to setuptools Feature and mark that "--without-cextensions" is removed, fixes #3500
* - Fixed bug in SQLite dialect where reflection of UNIQUE constraintsMike Bayer2015-07-211-0/+8
| | | | | | that included non-alphabetic characters in the names, like dots or spaces, would not be reflected with their name. fixes #3495
* - Fixed regression where :meth:`.ResultProxy.keys` would returnMike Bayer2015-07-192-1/+12
| | | | | | | | un-adjusted internal symbol names for "anonymous" labels, which are the "foo_1" types of labels we see generated for SQL functions without labels and similar. This was a side effect of the performance enhancements implemented as part of references #918. fixes #3483
* - db_opts doesn't need to be a global since we no longer have any globalMike Bayer2015-07-172-6/+4
| | | | | option for it. keep it local to production of config so values don't leak in a multi --db situation.
* - repair that we use db_opts when the url here is different,Mike Bayer2015-06-191-3/+8
| | | | as we are using db_opts for the first time with legacy_schema_args
* - fixes to the warnings filtersMike Bayer2015-06-191-3/+1
|
* - Add a new le_() assertion for less than or equalsMike Bayer2015-06-143-8/+14
| | | | | - fix TablesTest to use the bind that we've returned from setup_bind() to emit DELETE statements
* - Added a new dialect flag to the MSSQL dialectMike Bayer2015-05-241-0/+11
| | | | | | | | | | | | | | | | | | | | | | | ``legacy_schema_aliasing`` which when set to False will disable a very old and obsolete behavior, that of the compiler's attempt to turn all schema-qualified table names into alias names, to work around old and no longer locatable issues where SQL server could not parse a multi-part identifier name in all circumstances. The behavior prevented more sophisticated statements from working correctly, including those which use hints, as well as CRUD statements that embed correlated SELECT statements. Rather than continue to repair the feature to work with more complex statements, it's better to just disable it as it should no longer be needed for any modern SQL server version. The flag defaults to True for the 1.0.x series, leaving current behavior unchanged for this version series. In the 1.1 series, it will default to False. For the 1.0 series, when not set to either value explicitly, a warning is emitted when a schema-qualified table is first used in a statement, which suggests that the flag be set to False for all modern SQL Server versions. fixes #3424 fixes #3430
* - pg8000 wants to raise a ProgrammingError for a PK violationMike Bayer2015-05-152-0/+10
|
* - Added support for the case of the misbehaving DBAPI that hasMike Bayer2015-05-152-0/+40
| | | | | | | | | | | pep-249 exception names linked to exception classes of an entirely different name, preventing SQLAlchemy's own exception wrapping from wrapping the error appropriately. The SQLAlchemy dialect in use needs to implement a new accessor :attr:`.DefaultDialect.dbapi_exception_translation_map` to support this feature; this is implemented now for the py-postgresql dialect. fixes #3421
* Mark tests that they require OFFSET support in databasepr/171Peter Hoffmann2015-05-051-1/+4
| | | | | The sqlalchemy_exasol dialect needs to support Exasol 4.x which does not support the OFFSET feature. Mark test with testing.requires.offset so that they can be skipped of in the exasol specific test suite.
* - move away from explicit raises of SkipTest, instead call aMike Bayer2015-05-016-17/+36
| | | | | | | function patched onto config. nose/pytest backends now fill in their exception class here only when loaded - use more public seeming api to get at py.test Skipped exception
* - Fixed an import that prevented "pypy setup.py test" from workingMike Bayer2015-05-011-0/+1
| | | | | correctly. fixes #3406
* - replace old crufty ddl event test fixture with mockMike Bayer2015-04-271-2/+2
|
* - Fixed regression regarding the declarative ``__declare_first__``Mike Bayer2015-04-242-1/+13
| | | | | | and ``__declare_last__`` accessors where these would no longer be called on the superclass of the declarative base. fixes #3383
* - repair a regression caused by #3282, where we no longer wereMike Bayer2015-04-223-4/+18
| | | | | | | | | | applying any topological sort to tables on SQLite. See the changelog for details, but we now continue to sort tables for SQLite on DROP, prohibit the sort from considering alter, and only warn if we encounter an unresolvable cycle, in which case, then we forego the ordering. use_alter as always is used to break such a cycle. fixes #3378
* - Fixed a long-standing bug where the :class:`.Enum` type as usedMike Bayer2015-04-041-1/+1
| | | | | | | | | | with the psycopg2 dialect in conjunction with non-ascii values and ``native_enum=False`` would fail to decode return results properly. This stemmed from when the PG :class:`.postgresql.ENUM` type used to be a standalone type without a "non native" option. fixes #3354 - corrected the assertsql comparison rule to expect a non-ascii SQL string
* - fix this for pg8000 of all backends...Mike Bayer2015-03-241-1/+1
|
* - Turned off the "simple order by" flag on the MSSQL dialect; thisMike Bayer2015-03-241-0/+9
| | | | | | | | | | | is the flag that per :ticket:`2992` causes an order by or group by an expression that's also in the columns clause to be copied by label, even if referenced as the expression object. The behavior for MSSQL is now the old behavior that copies the whole expression in by default, as MSSQL can be picky on these particularly in GROUP BY expressions. fixes #3338 - Add a test that includes a composed label in a GROUP BY
* - The "auto close" for :class:`.ResultProxy` is now a "soft" close.Mike Bayer2015-03-171-3/+6
| | | | | | | | | | | That is, after exhausing all rows using the fetch methods, the DBAPI cursor is released as before and the object may be safely discarded, but the fetch methods may continue to be called for which they will return an end-of-result object (None for fetchone, empty list for fetchmany and fetchall). Only if :meth:`.ResultProxy.close` is called explicitly will these methods raise the "result is closed" error. fixes #3330 fixes #3329
* - copyright 2015Mike Bayer2015-03-1018-18/+18
|
* - expect_warnings was not expecting and neither was assert_warningsMike Bayer2015-02-192-29/+51
| | | | asserting.
* - additional test adjustments for pypy / psycopg2cffi. ThisMike Bayer2015-01-261-0/+4
| | | | | | | | | | consists mainly of adjusting fixtures to ensure connections are closed explicitly. psycopg2cffi also handles unicode bind parameter names differently than psycopg2, and seems to possibly have a little less control over floating point values at least in one test which is marked as a "fail", though will see if it runs differently on linux than osx.. - changelog for psycopg2cffi, fixes #3052
* - rework assertsql system, fixes #3293Mike Bayer2015-01-183-294/+242
|
* - add an exclusion here that helps with the case of 3rd partyMike Bayer2015-01-171-1/+2
| | | | test suite redefining an existing test in test_suite
* - The multi-values version of :meth:`.Insert.values` has beenMike Bayer2015-01-131-0/+3
| | | | | | | | | | | | repaired to work more usefully with tables that have Python- side default values and/or functions, as well as server-side defaults. The feature will now work with a dialect that uses "positional" parameters; a Python callable will also be invoked individually for each row just as is the case with an "executemany" style invocation; a server- side default column will no longer implicitly receive the value explicitly specified for the first row, instead refusing to invoke without an explicit value. fixes #3288
* - more callcountsMike Bayer2015-01-051-2/+4
| | | | - add the platform key to the error output
* - test failures:Mike Bayer2015-01-021-1/+0
| | | | | - test_schema_2 is only on PG and doesn't need a drop all, omit this for now - py3k has exception.args[0], not message
* - repair drop_all_tablesMike Bayer2015-01-021-1/+1
|