summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/provision.py
Commit message (Collapse)AuthorAgeFilesLines
* Render N'' for SQL Server unicode literalsMike Bayer2019-01-151-6/+3
| | | | | | | | | | | | | | | | | | The ``literal_processor`` for the :class:`.Unicode` and :class:`.UnicodeText` datatypes now render an ``N`` character in front of the literal string expression as required by SQL Server for Unicode string values rendered in SQL expressions. Note that this adds full unicode characters to the standard test suite, which means we also need to bump MySQL provisioning up to utf8mb4. Modern installs do not seem to be reproducing the 1271 issue locally, if it reproduces in CI it would be better for us to skip those ORM-centric tests for MySQL. Also remove unused _StringType from SQL Server dialect Fixes: #4442 Change-Id: Id55817b3e8a2d81ddc8b7b27f85e3f1dcc1cea7e
* Post black reformattingMike Bayer2019-01-061-8/+14
| | | | | | | | | | | | | Applied on top of a pure run of black -l 79 in I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes resolves all remaining flake8 conditions for those codes we have enabled in setup.cfg. Included are resolutions for all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
* Run black -l 79 against all source filesMike Bayer2019-01-061-38/+48
| | | | | | | | | | | | | | This is a straight reformat run using black as is, with no edits applied at all. The black run will format code consistently, however in some cases that are prevalent in SQLAlchemy code it produces too-long lines. The too-long lines will be resolved in the following commit that will resolve all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
* Assorted pre-Black fixesMike Bayer2019-01-051-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes to the test suite, a few errant imports, and setup.py: - mysql and postgresql have unused 'json' imports; remove - postgresql is exporting the 'json' symbol, remove - make sure setup.py can find __version__ using " or ' - retry logic in provision create database for postgresql fixed - refactor test_magazine to use cls.tables rather than globals - remove unused class in test_scoping - add a comment to test_deprecations that this test suite itself is deprecated - don't use mapper() and orm_mapper() in test_unitofwork, just use mapper() - remove dupe test_scalar_set_None test in test_attributes - Python 2.7 and above includes unittest.SkipTest, remove pre-2.7 fallback - use imported SkipTest in profiling - declarative test_reflection tests with "reflectable_autoincrement" already don't run on oracle or firebird; remove conditional logic for these, which also removes an "id" symbol - clean up test in test_functions, remove print statement - remove dupe test_literal_processor_coercion_native_int_out_of_range in test/sql/test_types.py - fix psycopg2_hstore ref Change-Id: I7b3444f8546aac82be81cd1e7b6d8b2ad6834fe6
* Add unique_constraint_name to MSSQL FK reflectionSean Dunn2018-06-291-0/+1
| | | | | | | | | | | Fixed bug in MSSQL reflection where when two same-named tables in different schemas had same-named primary key constraints, foreign key constraints referring to one of the tables would have their columns doubled, causing errors. Pull request courtesy Sean Dunn. Fixes: #4228 Change-Id: I7dabaaee0944e1030048826ba39fc574b0d63031 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/457
* Use utf8mb4 (or utf8mb3) for all things MySQLMike Bayer2018-06-251-3/+9
| | | | | | | | | | | | | | | | | Fixed bug in MySQLdb dialect and variants such as PyMySQL where an additional "unicode returns" check upon connection makes explicit use of the "utf8" character set, which in MySQL 8.0 emits a warning that utf8mb4 should be used. This is now replaced with a utf8mb4 equivalent. Documentation is also updated for the MySQL dialect to specify utf8mb4 in all examples. Additional changes have been made to the test suite to use utf8mb3 charsets and databases (there seem to be collation issues in some edge cases with utf8mb4), and to support configuration default changes made in MySQL 8.0 such as explicit_defaults_for_timestamp as well as new errors raised for invalid MyISAM indexes. Change-Id: Ib596ea7de4f69f976872a33bffa4c902d17dea25 Fixes: #4283 Fixes: #4192
* Refactor for cx_Oracle version 6oracle_numericMike Bayer2017-09-111-1/+1
| | | | | | | | | Drops support for cx_Oracle prior to version 5.x, reworks numeric and binary support. Fixes: #4064 Change-Id: Ib9ae9aba430c15cd2a6eeb4e5e3fd8e97b5fe480
* Add SQL Server CI coverageMike Bayer2017-08-311-38/+112
| | | | Change-Id: Ida0d01ae9bcc0573b86e24fddea620a38c962822
* - allow a separate template database to be used forMike Bayer2017-08-221-5/+8
| | | | | | | PG CREATE DATABASE. as nobody will connect to it that would solve the contention issue here Change-Id: I00a4d52091876e120faff4a8a5493c53280d96f1
* - simplify and see if it still worksMike Bayer2017-08-211-23/+6
| | | | Change-Id: Id0cf7ae2223507d413aaa22e5f8df066b7ac2b46
* - keep trying to get PG dbs to buildMike Bayer2017-08-211-0/+11
| | | | Change-Id: Ib36949da8f079594494a482423d96e7509673481
* - add missing quotesMike Bayer2017-08-211-1/+1
| | | | Change-Id: Ib6efc465cccd7c7661dd089856edfd4979b53517
* - try to get PG database create to be more reliableMike Bayer2017-08-211-1/+10
| | | | Change-Id: I9c9d101547f4484af447db924dc06afd0392a03e
* - filter out non-oracle URLsMike Bayer2017-08-211-0/+2
| | | | Change-Id: I475f744f8801bc923d738e466d208d662e707413
* - rework oracle de-provisioning to write URLs to the file as well,Mike Bayer2017-08-201-29/+42
| | | | | | supporting custom dburi etc. Change-Id: Ic0ab0b3b4223e40fd335ee3313fda4dfce942100
* - add some logging for the provisioningMike Bayer2017-08-191-0/+2
| | | | Change-Id: I1ac16bc77642f4f576195ac10443ed8e641e0d49
* - do ten attempts to create databaseMike Bayer2017-08-191-1/+1
| | | | Change-Id: I14a5dd920d14096aa4401cb8b9d71f47d3915879
* Allow multiple versions of single backendMike Bayer2017-08-041-0/+1
| | | | | | | | | | Improve screen output to illustrate which server version is running for a particular database config, and additionally allow full overriding for the backend-specific targets in tox.ini via environment variables, so that CI can inject multiple server urls for a particular database such as MySQL/MariaDB. Change-Id: Ibf443bb9fb82e4563efd1bb66058fa9989aa2fda
* New features from python 2.7Катаев Денис2017-03-171-1/+1
| | | | | | | 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
* Repair _execute_scalar for WITH_UNICODE modeMike Bayer2017-03-131-0/+6
| | | | | | | | | | | | | | | | | cx_Oracle 5.3 seems to code this flag ON now, so remove the warning and ensure WITH_UNICODE handling works. Additionally, the XE setup on jenkins is having more problems here, in particular low-connections mode is causing cx_Oracle to fail more frequently now. Turning off low-connections fixes those but then we get the TNS errors, so adding an emergency "retry" flag that is not yet a feature available to users. Real world applications are not dropping/creating thousands of tables the way our test suite is. Change-Id: Ie95b0e697276c404d3264c2e624e870463d966d6 Fixes: #3937
* - limit oracle DB reaps to identifiers generated from thisMike Bayer2016-06-021-3/+7
| | | | | | run to prevent race conditions against concurrent runs Change-Id: I065d1cec346ea7af03792c3cc2f30766f73c2bd3
* Let logging format messages on demand, use warning instead of deprecated warnpr/265Ville Skyttä2016-05-031-2/+2
|
* - not sure why MySQL DROP DBs fail but we can't just ignore the errorMike Bayer2016-03-031-12/+3
| | | | like this
* - don't drop the ts1/ts2 databases without seeing the primary DB,Mike Bayer2016-02-091-6/+21
| | | | | because we never log in on the ts1/ts2. races against other runs and erases their DBs
* - Testing reveals that we have *no* weak references to any cx_Oracle ↵Mike Bayer2016-02-081-9/+32
| | | | | | | | connections at all, yet cx_Oracle still has open sessions that cannot be killed until process dies. Oracle wins! Add a completely separate DB reaper script that runs after py.test is done.
* - attempt a different style of session killMike Bayer2016-02-081-1/+2
|
* - add a session killer for oracle provisioningMike Bayer2016-02-041-0/+5
|
* - more oracle fixesMike Bayer2016-02-031-4/+9
|
* - add multi-database provisioning for oracleMike Bayer2016-02-031-0/+29
|
* - put a retry in for PG database provisioning as it locksMike Bayer2016-01-291-1/+14
| | | | on database use
* - 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
* - db_opts doesn't need to be a global since we no longer have any globalMike Bayer2015-07-171-1/+2
| | | | | option for it. keep it local to production of config so values don't leak in a multi --db situation.
* - 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
* cleanup exception handling - use new exception hierarchy (since python 2.5)pr/140ndparker2014-10-021-15/+5
|
* improve exception vs. exit handlingndparker2014-09-231-0/+10
|
* - remove some crufty old testing optionsMike Bayer2014-09-141-0/+189
- reestablish the "bootstrap" system of loading the test runners in testing/plugin; using the updated approach we just came up with for alembic. Coverage should be fixed now when running either py.test or nose. fixes #3196 - upgrade tox.ini and start using a .coveragerc file