summaryrefslogtreecommitdiff
path: root/test/engine/test_parseconnect.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix query string escaping in engine URLsMiguel Grinberg2020-05-211-0/+5
| | | | | | | | | | | | | Fixed issue in :class:`.URL` object where stringifying the object would not URL encode special characters, preventing the URL from being re-consumable as a real URL. Pull request courtesy Miguel Grinberg. Fixes: #5341 Closes: #5342 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5342 Pull-request-sha: 362ca3398336a3a892e8020530f0c68d4f2d1d01 Change-Id: Ief6218122d1ec0c70479eb1a90e1c16433801924
* run a black runMike Bayer2019-03-051-5/+14
| | | | | | fix some pep8s that snuck in Change-Id: Ied282007df30a52d232b1ba88659f2a123ff380f
* Add port comparison in __eq__() and __ne__() method to URLSanjana2019-02-281-1/+26
| | | | | | | | | | | | | | | | | Comparing two objects of :class:`.URL` using ``__eq__()`` did not take port number into consideration, two objects differing only by port number were considered equal. Port comparison is now added in ``__eq__()`` method of :class:`.URL`, objects differing by port number are now not equal. Additionally, ``__ne__()`` was not implemented for :class:`.URL` which caused unexpected result when ``!=`` was used in Python2, since there are no implied relationships among the comparison operators in Python2. Fixes: #4406 Closes: #4515 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4515 Pull-request-sha: 0f15b805f07e7fca1f82ca6c3aad98d50ea705b8 Change-Id: Iba7d224f1282dc3f4b884d1a746f2d46669f551e
* Add deprecation warnings to all deprecated APIsMike Bayer2019-01-231-19/+0
| | | | | | | | | | | | | | | A large change throughout the library has ensured that all objects, parameters, and behaviors which have been noted as deprecated or legacy now emit ``DeprecationWarning`` warnings when invoked. As the Python 3 interpreter now defaults to displaying deprecation warnings, as well as that modern test suites based on tools like tox and pytest tend to display deprecation warnings, this change should make it easier to note what API features are obsolete. See the notes added to the changelog and migration notes for further details. Fixes: #4393 Change-Id: If0ea11a1fc24f9a8029352eeadfc49a7a54c0a1b
* Post black reformattingMike Bayer2019-01-061-8/+16
| | | | | | | | | | | | | 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-182/+238
| | | | | | | | | | | | | | 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
* Allow multiple plugin namesMike Bayer2018-02-131-3/+127
| | | | | | | | | | | | The :class:`.URL` object now allows query keys to be specified multiple times where their values will be joined into a list. This is to support the plugins feature documented at :class:`.CreateEnginePlugin` which documents that "plugin" can be passed multiple times. Additionally, the plugin names can be passed to :func:`.create_engine` outside of the URL using the new :paramref:`.create_engine.plugins` parameter. Change-Id: Ifc48ad120bd6c6204eda567492caf79832aeeaa5 Fixes: #4170
* Allow url.password to be an objectMike Bayer2017-12-041-1/+34
| | | | | | | | | | | | The "password" attribute of the :class:`.url.URL` object can now be any user-defined or user-subclassed string object that responds to the Python ``str()`` builtin. The object passed will be maintained as the datamember :attr:`.url.URL.password_original` and will be consulted when the :attr:`.url.URL.password` attribute is read to produce the string value. Change-Id: I91d101c3b10e135ae7e4de60a5104b51776db84f Fixes: #4089
* Make all tests to be PEP8 compliantKhairi Hafsham2017-02-071-2/+3
| | | | | | | | tested using pycodestyle version 2.2.0 Fixes: #3885 Change-Id: I5df43adc3aefe318f9eeab72a078247a548ec566 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/343
* Additions to support HAAlchemy pluginMike Bayer2016-09-161-0/+3
| | | | | | | | | | | | | | | | | | | - add a connect=True key to connection record to support pre-loading of _ConnectionRecord objects - ensure _ConnectionRecord.close() leaves the record in a good state for reopening - add _ConnectionRecord.record_info for persistent storage - add "in_use" accessor based on fairy_ref being present or not - allow for the exclusions system and SuiteRequirements to be usable without the full plugin_base setup. - move some Python-env requirements to the importable requirements.py module. - allow starttime to be queried - add additional events for engine plugins - have "dialect" be a first-class parameter to the pool, ensure the engine strategy supplies it up front Change-Id: Ibf549f7a1766e49d335cd6f5e26bacfaef9a8229
* - Added a new entrypoint system to the engine to allow "plugins" toMike Bayer2016-01-061-8/+35
| | | | | | | | | | | be stated in the query string for a URL. Custom plugins can be written which will be given the chance up front to alter and/or consume the engine's URL and keyword arguments, and then at engine create time will be given the engine itself to allow additional modifications or event registration. Plugins are written as a subclass of :class:`.CreateEnginePlugin`; see that class for details. fixes #3536
* - Fixed bug where known boolean values used byMike Bayer2015-05-261-0/+17
| | | | | | | | :func:`.engine_from_config` were not being parsed correctly; these included ``pool_threadlocal`` and the psycopg2 argument ``use_native_unicode``. fixes #3435 - add legacy_schema_aliasing config parsing for mssql - move use_native_unicode config arg to the psycopg2 dialect
* - New features added to support engine/pool plugins with advancedMike Bayer2015-04-301-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | functionality. Added a new "soft invalidate" feature to the connection pool at the level of the checked out connection wrapper as well as the :class:`._ConnectionRecord`. This works similarly to a modern pool invalidation in that connections aren't actively closed, but are recycled only on next checkout; this is essentially a per-connection version of that feature. A new event :class:`.PoolEvents.soft_invalidate` is added to complement it. fixes #3379 - Added new flag :attr:`.ExceptionContext.invalidate_pool_on_disconnect`. Allows an error handler within :meth:`.ConnectionEvents.handle_error` to maintain a "disconnect" condition, but to handle calling invalidate on individual connections in a specific manner within the event. - Added new event :class:`.DialectEvents.do_connect`, which allows interception / replacement of when the :meth:`.Dialect.connect` hook is called to create a DBAPI connection. Also added dialect plugin hooks :meth:`.Dialect.get_dialect_cls` and :meth:`.Dialect.engine_created` which allow external plugins to add events to existing dialects using entry points. fixes #3355
* - Added the string value ``"none"`` to those accepted by theMike Bayer2015-04-211-0/+15
| | | | | | | | :paramref:`.Pool.reset_on_return` parameter as a synonym for ``None``, so that string values can be used for all settings, allowing .ini file utilities like :func:`.engine_from_config` to be usable without issue. fixes #3375
* - rework the handle error on connect tests from test_parsconnect whereMike Bayer2014-12-101-236/+0
| | | | they don't really belong into a new suite in test_execute
* - identify another spot where _handle_dbapi_error() needs to do somethingMike Bayer2014-12-081-0/+28
| | | | | differently for the case where it is called in an already-invalidated state; don't call upon self.connection
* - adjust _revalidate_connection() again such that we pass a _wrap=FalseMike Bayer2014-12-051-1/+1
| | | | | | | | | | to it, so that we say we will do the wrapping just once right here in _execute_context() / _execute_default(). An adjustment is made to _handle_dbapi_error() to not assume self.__connection in case we are already in an invalidated state further adjustment to 0639c199a547343d62134d2f233225fd2862ec45, 41e7253dee168b8c26c49, #3266
* - move inner calls to _revalidate_connection() outside of existingMike Bayer2014-12-051-1/+34
| | | | | _handle_dbapi_error(); these are now handled already and the reentrant call is not needed / breaks things. Adjustment to 41e7253dee168b8c26c49 /
* - The engine-level error handling and wrapping routines will nowMike Bayer2014-12-051-1/+112
| | | | | | | | | take effect in all engine connection use cases, including when user-custom connect routines are used via the :paramref:`.create_engine.creator` parameter, as well as when the :class:`.Connection` encounters a connection error on revalidation. fixes #3266
* - pep8 cleanupMike Bayer2014-12-051-58/+77
|
* - The :func:`.engine_from_config` function has been improved so thatMike Bayer2013-12-071-60/+31
| | | | | | | | we will be able to parse dialect-specific arguments from string configuration dictionaries. Dialect classes can now provide their own list of parameter types and string-conversion routines. The feature is not yet used by the built-in dialects, however. [ticket:2875]
* - A DBAPI that raises an error on ``connect()`` which is not a subclassMike Bayer2013-12-071-7/+28
| | | | | | | | | | | | of dbapi.Error (such as ``TypeError``, ``NotImplementedError``, etc.) will propagate the exception unchanged. Previously, the error handling specific to the ``connect()`` routine would both inappropriately run the exception through the dialect's :meth:`.Dialect.is_disconnect` routine as well as wrap it in a :class:`sqlalchemy.exc.DBAPIError`. It is now propagated unchanged in the same way as occurs within the execute process. [ticket:2881] - add tests for this in test_parseconnect, but also add tests in test_execute to ensure the execute() behavior as well
* - adjustment, the spec says: "Within the user and password field, any ":",Mike Bayer2013-11-251-10/+10
| | | | | | | "@", or "/" must be encoded." - so re-apply encoding to both password and username, don't encode spaces as plus signs, don't encode any chars outside of :, @, / on stringification - but we still parse for any %XX character (is that right?)
* - The :func:`.create_engine` routine and the relatedMike Bayer2013-11-241-1/+23
| | | | | | | :func:`.make_url` function **no longer URL encode the password**. Database passwords that include characters like spaces, plus signs and anything else should now represent these characters directly, without any URL escaping. [ticket:2873]
* - The regexp used by the :func:`.url.make_url` function now parsesMike Bayer2013-10-231-12/+19
| | | | ipv6 addresses, e.g. surrounded by brackets. [ticket:2851]
* Hide password in URL and Engine __repr__pr/25Gunnlaugur Þór Briem2013-09-061-0/+4
| | | | Fixes #2821
* - replace most explicitly-named test objects called "Mock..." withMike Bayer2013-06-301-39/+25
| | | | | | | | | | | | actual mock objects from the mock library. I'd like to use mock for new tests so we might as well use it in obvious places. - use unittest.mock in py3.3 - changelog - add a note to README.unittests - add tests_require in setup.py - have tests import from sqlalchemy.testing.mock - apply usage of mock to one of the event tests. we can be using this approach all over the place.
* that's all of engineMike Bayer2013-05-041-4/+3
|
* - the raw 2to3 runMike Bayer2013-04-271-6/+6
| | | | - went through examples/ and cleaned out excess list() calls
* trying different approaches to test layout. in this one, the testing modulesMike Bayer2012-09-271-2/+3
| | | | | | | 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.
* - break out engine/base.py into base, interfaces, result, util.Mike Bayer2012-08-071-3/+3
| | | | - remove deprecated 0.7 engine methods
* -whitespace bonanza, contdMike Bayer2012-07-281-3/+3
|
* - [feature] Added a new systemMike Bayer2012-04-241-0/+39
| | | | | | | for registration of new dialects in-process without using an entrypoint. See the docs for "Registering New Dialects". [ticket:2462]
* - [feature] Added pool_reset_on_return argumentMike Bayer2012-02-011-3/+24
| | | | | | | | to create_engine, allows control over "connection return" behavior. Also added new arguments 'rollback', 'commit', None to pool.reset_on_return to allow more control over connection return activity. [ticket:2378]
* - fix up the invalidate on connect for py3kMike Bayer2011-07-061-1/+2
| | | | - fix the test for separately installed pysqlite
* - Failures on connect which raise dbapi.ErrorMike Bayer2011-07-011-12/+43
| | | | | | | | | | | | will forward the error to dialect.is_disconnect() and set the "connection_invalidated" flag if the dialect knows this to be a potentially "retryable" condition. Only Oracle ORA-01033 implemented for now. [ticket:2201] - Added ORA-01033 to disconnect codes, which can be caught during a connection event. [ticket:2201]
* - remove test.sql._base, test.engine._base, test.orm._base, move those ↵Mike Bayer2011-03-271-5/+4
| | | | | | | classes to a new test.lib.fixtures module - move testing.TestBase to test.lib.fixtures - massive search and replace
* see #2060Diana Clarke2011-02-281-2/+2
|
* - whitespace removal bonanzaMike Bayer2011-01-021-1/+1
|
* - move sqlalchemy.test to test.libMike Bayer2010-11-151-2/+2
|
* - engine_from_config() now accepts 'debug' forMike Bayer2010-10-151-0/+16
| | | | | | 'echo', 'echo_pool', 'force' for 'convert_unicode', boolean values for 'use_native_unicode'. [ticket:1899]
* Python-tidy test/engine and test/aaa_profiling, 80% auto + 20% manual ↵Mike Bayer2010-07-111-60/+122
| | | | intervention
* another weird nose + py3k fixMike Bayer2010-02-201-1/+2
|
* add "dialect" to the __all__ of each root dialect packageMike Bayer2009-11-011-1/+9
|
* test fixesMike Bayer2009-10-261-3/+7
|
* merge 0.6 series to trunk.Mike Bayer2009-08-061-75/+52
|
* - unit tests have been migrated from unittest to nose.Mike Bayer2009-06-101-0/+230
See README.unittests for information on how to run the tests. [ticket:970]