summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/assertions.py
Commit message (Collapse)AuthorAgeFilesLines
* Refactor for cx_Oracle version 6oracle_numericMike Bayer2017-09-111-1/+0
| | | | | | | | | Drops support for cx_Oracle prior to version 5.x, reworks numeric and binary support. Fixes: #4064 Change-Id: Ib9ae9aba430c15cd2a6eeb4e5e3fd8e97b5fe480
* Enable multi-level selectin polymorphic loadingMike Bayer2017-08-071-8/+5
| | | | | Change-Id: Icc742bbeecdb7448ce84caccd63e086af16e81c1 Fixes: #4026
* selectin polymorphic loadingMike Bayer2017-06-051-2/+3
| | | | | | | | | | | | | Added a new style of mapper-level inheritance loading "polymorphic selectin". This style of loading emits queries for each subclass in an inheritance hierarchy subsequent to the load of the base object type, using IN to specify the desired primary key values. Fixes: #3948 Change-Id: I59e071c6142354a3f95730046e3dcdfc0e2c4de5
* Allow metadata.reflect() to recover from unreflectable tablesMike Bayer2017-05-221-4/+11
| | | | | | | | | | | | | Added support for views that are unreflectable due to stale table definitions, when calling :meth:`.MetaData.reflect`; a warning is emitted for the table that cannot respond to ``DESCRIBE`` but the operation succeeds. The MySQL dialect now raises UnreflectableTableError which is in turn caught by MetaData.reflect(). Reflecting the view standalone raises this error directly. Change-Id: Id8005219d8e073c154cc84a873df911b4a6cf4d6 Fixes: #3871
* Add safe_reraise() + warnings only to Connection._autorollbackMike Bayer2017-03-271-4/+5
| | | | | | | | | | | | Added an exception handler that will warn for the "cause" exception on Py2K when the "autorollback" feature of :class:`.Connection` itself raises an exception. In Py3K, the two exceptions are naturally reported by the interpreter as one occurring during the handling of the other. This is continuing with the series of changes for rollback failure handling that were last visited as part of :ticket:`2696` in 1.0.12. Change-Id: I600ba455a14ebaea27c6189889181f97c632f179 Fixes: #3946
* Support hybrids/composites with bulk updatesMike Bayer2017-03-221-0/+4
| | | | | | | | | | | The :meth:`.Query.update` method can now accommodate both hybrid attributes as well as composite attributes as a source of the key to be placed in the SET clause. For hybrids, an additional decorator :meth:`.hybrid_property.update_expression` is supplied for which the user supplies a tuple-returning function. Change-Id: I15e97b02381d553f30b3301308155e19128d2cfb Fixes: #3229
* New features from python 2.7Катаев Денис2017-03-171-3/+3
| | | | | | | After bump minimum supported version to 2.7 (1da9d3752160430c91534a8868ceb8c5ad1451d4), we can use new syntax. Change-Id: Ib064c75a00562e641d132f9c57e5e69744200e05 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/347
* update for 2017 copyrightMike Bayer2017-01-041-1/+1
| | | | Change-Id: I4e8c2aa8fe817bb2af8707410fa0201f938781de
* Repair clauselist comparison to account for clause orderingMike Bayer2016-09-021-0/+8
| | | | | | | | | | | | | | | | Fixed bug where the "simple many-to-one" condition that allows lazy loading to use get() from identity map would fail to be invoked if the primaryjoin of the relationship had multiple clauses separated by AND which were not in the same order as that of the primary key columns being compared in each clause. This ordering difference occurs for a composite foreign key where the table-bound columns on the referencing side were not in the same order in the .c collection as the primary key columns on the referenced side....which in turn occurs a lot if one is using declarative mixins and/or declared_attr to set up columns. Change-Id: I66cce74f614c04ed693dc0d58ac8c952b2f8ae54 Fixes: #3788
* - don't raise for stray gc connection. this just happensMike Bayer2016-06-021-2/+3
| | | | | | | sometimes and it really breaks the build once this error occurs. Change-Id: I577c78d623b22a6429f8b083fe08821bc467eb7a
* - handle parameter sets that aren't correctly formed, so thatMike Bayer2016-02-171-0/+4
| | | | | for example an exception object made within a test suite can still repr (error seen in Keystone)
* - CTE functionality has been expanded to support all DML, allowingMike Bayer2016-02-111-0/+2
| | | | | | | INSERT, UPDATE, and DELETE statements to both specify their own WITH clause, as well as for these statements themselves to be CTE expressions when they include a RETURNING clause. fixes #2551
* - happy new yearMike Bayer2016-01-291-1/+1
|
* - 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
* - Multi-tenancy schema translation for :class:`.Table` objects is added.Mike Bayer2016-01-081-1/+5
| | | | | | | | | 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
* - 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
* - Fixed regression where :meth:`.ResultProxy.keys` would returnMike Bayer2015-07-191-0/+10
| | | | | | | | 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
* - fixes to the warnings filtersMike Bayer2015-06-191-3/+1
|
* - Add a new le_() assertion for less than or equalsMike Bayer2015-06-141-0/+5
| | | | | - fix TablesTest to use the bind that we've returned from setup_bind() to emit DELETE statements
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - expect_warnings was not expecting and neither was assert_warningsMike Bayer2015-02-191-12/+40
| | | | asserting.
* - rework assertsql system, fixes #3293Mike Bayer2015-01-181-8/+3
|
* - 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
* - rework the assert_sql system so that we have a context manager to work with,Mike Bayer2014-12-071-5/+8
| | | | use events that are local to the engine and to the run and are removed afterwards.
* - refine this a bit to better check for exception typeMike Bayer2014-08-311-7/+8
|
* - A new style of warning can be emitted which will "filter" up toMike Bayer2014-08-311-67/+62
| | | | | | | | | N occurrences of a parameterized string. This allows parameterized warnings that can refer to their arguments to be delivered a fixed number of times until allowing Python warning filters to squelch them, and prevents memory from growing unbounded within Python's warning registries. fixes #3178
* - allow 10 stray connections that need a gcMike Bayer2014-07-221-4/+7
| | | | - be specific as to what occurred when we collect stray gc
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-23/+33
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-261-1/+1
| | | | Found using: https://github.com/intgr/topy
* dont warn, that just crashes the test...Mike Bayer2014-03-261-2/+3
|
* try to liberalize the pool._refs assertion a bitMike Bayer2014-03-261-2/+34
|
* - Support has been added for pytest to run tests. This runnerMike Bayer2014-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - add support for specifying tables or entities for "of"Mike Bayer2013-11-281-2/+2
| | | | | - implement Query with_for_update() - rework docs and tests
* adjustment to work on py3k as wellMike Bayer2013-11-211-1/+3
|
* - Fixed bug which prevented the ``serializer`` extension from workingMike Bayer2013-11-211-1/+1
| | | | | correctly with table or column names that contain non-ASCII characters. [ticket:2869]
* - add copyright to source files missing itMike Bayer2013-10-261-0/+6
|
* - The typing system now handles the task of rendering "literal bind" values,Mike Bayer2013-10-201-1/+10
| | | | | | | | | | | | | | | e.g. values that are normally bound parameters but due to context must be rendered as strings, typically within DDL constructs such as CHECK constraints and indexes (note that "literal bind" values become used by DDL as of :ticket:`2742`). A new method :meth:`.TypeEngine.literal_processor` serves as the base, and :meth:`.TypeDecorator.process_literal_param` is added to allow wrapping of a native literal rendering method. [ticket:2838] - enhance _get_colparams so that we can send flags like literal_binds into INSERT statements - add support in PG for inspecting standard_conforming_strings - add a new series of roundtrip tests based on INSERT of literal plus SELECT for basic literal rendering in dialect suite
* The MySQL :class:`.mysql.SET` type now features the same auto-quotingMike Bayer2013-10-141-21/+27
| | | | | | | behavior as that of :class:`.mysql.ENUM`. Quotes are not required when setting up the value, but quotes that are present will be auto-detected along with a warning. This also helps with Alembic where the SET type doesn't render with quotes. [ticket:2817]
* clean up the dialect selection thing hereMike Bayer2013-06-041-8/+12
|
* working through tests....Mike Bayer2013-06-021-6/+7
|
* - endless isinstance(x, str)s....Mike Bayer2013-04-281-12/+12
|
* - the raw 2to3 runMike Bayer2013-04-271-15/+16
| | | | - went through examples/ and cleaned out excess list() calls
* just a pep8 pass of lib/sqlalchemy/testing/Diana Clarke2012-11-191-6/+21
|
* - add a nifty contextmanager form of assert_execution/assert_statement_countMike Bayer2012-10-081-0/+11
|
* - don't call get_lastrowid() on explicit returningMike Bayer2012-10-041-1/+3
| | | | | | - don't hardwire "subqueries" requirement in the base, mysql < 4.1 isn't working anyway - don't need explicit FB/PG exclusions in test_returning - hit db.connect() for the returning requirement
* trying different approaches to test layout. in this one, the testing modulesMike Bayer2012-09-271-0/+349
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.