Commit Graph

52 Commits

Author SHA1 Message Date
Mike Bayer 38bb05c7cd Move max-worker-restart to pytest-xdist options in tox.ini
This way py.test can be run on the outside without a
command line error.

Change-Id: Ia3689806bffbabe176a827cca2f099e89a60ebf5
Closes: #4989
(cherry picked from commit 3ceb87da1a)
2019-11-19 12:40:22 -05:00
Mike Bayer 8b2ad56981 Enable F841
This is a very useful assertion which prevents unused variables
from being set up allows code to be more readable and sometimes
even more efficient.  test suites seem to be where the most
problems are and there do not seem to be documentation examples
that are using this, or at least the linter is not taking effect
within rst blocks.

Change-Id: I2b3341d8dd14da34879d8425838e66a4b9f8e27d
(cherry picked from commit 190e0139e8)
2019-06-21 10:18:17 -04:00
Mike Bayer 26e9d9f965 - add --max-worker-restart to better tolerate oracle / python 3.8 crashes
Change-Id: I4f59cd69dc2319732acf64cb000946c09124ceff
(cherry picked from commit e2521b595a)
2019-06-08 11:23:56 -04:00
mike bayer 2a2f7fe88c Merge "Remove Nose support" 2019-02-03 17:45:28 +00:00
Parth Shandilya d427d0643b Remove Nose support
The test system has removed support for Nose, which is unmaintained for
several years and is producing warnings under Python 3. The test suite is
currently standardized on Pytest.  Pull request courtesy Parth Shandilya.

Fixes: #4460

Closes: #4476
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4476
Pull-request-sha: e857af9c7d

Change-Id: I76516fae1cf0eb58f2e9fc9f692e591e0fcf39a4
2019-02-02 11:25:44 -05:00
Mike Bayer 5ae8a54ed3 repair F632 issue
in b8f9517cdd we disabled this new error
coming up, but it's just this one line in a test that is in fact wrong.

Change-Id: I4e3612596e9735c7db066832d13ccb454c93808f
2019-02-01 21:34:53 -05:00
Mike Bayer b8f9517cdd Add F632 another issue that just popped up
Change-Id: I4658615f450ed670bbde39e085e1b1f913e3736f
2019-01-30 21:04:47 -06:00
Mike Bayer 1e29997dcc add F821 which for some reason is some new thing flake8 wants to complain about
Change-Id: I27df129ae883d75217ec07ff6d0139447444cc60
2019-01-30 21:00:36 -06:00
Mike Bayer c0e6ebd70b Render N'' for SQL Server unicode literals
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
2019-01-15 10:04:09 -05:00
Mike Bayer d229360a8d Prep for flake8 refactoring
a few code changes ahead of time to handle some __all__
issues better.  also include new flake8 rules, since the
existing flake8 doesn't pass in any case.

Change-Id: I1efdf75124ae7bcac719c22e505bb5b13db06c04
2019-01-03 22:28:09 -05:00
Mike Bayer 3316890ffa turn off pytest's latest plugin we didn't ask for, logging
Change-Id: I24d57894c519366febbce268b04474182dfbb0a1
2018-01-05 15:31:10 -05:00
Jeff Widman bcbff960a1 Add license to Wheel metadata
https://wheel.readthedocs.io/en/stable/index.html#including-the-license-in-the-generated-wheel-file

Change-Id: Icf91b96ba534c8f835ad287e7840ac2a9d2ac502
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/397
2017-11-15 18:10:25 -05:00
Mike Bayer 31f80b9eae Refactor for cx_Oracle version 6
Drops support for cx_Oracle prior to version 5.x, reworks
numeric and binary support.

Fixes: #4064

Change-Id: Ib9ae9aba430c15cd2a6eeb4e5e3fd8e97b5fe480
2017-09-11 14:17:10 -04:00
Mike Bayer a987942761 - add option to disable py.test warnings plugin;
lift cap on py.test.
references: https://github.com/pytest-dev/pytest/issues/2430

Change-Id: Ieb8a6258ba1d15efa570d9cda2b51cf021499a23
2017-05-23 12:24:26 -04:00
Gábor Lipták f624a3ae8b Correct pytest deprecation warning
WC1 None [pytest] section in setup.cfg files is deprecated, use [tool:pytest] instead.

Change-Id: I099c8207730ae1226f7357ff8be0d8ab149878ed
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/334
2017-01-17 12:13:34 -05:00
Mike Bayer 7e619d0be4 - adjust to allow dblink tests to work with multiprocess users.
unfortunately the synonym doesn't work for SQL statements here
when the dblink is on a different user, testing this is not really
critical so just removed it.
2016-02-08 13:13:39 -05:00
Mike Bayer 6b05150392 - add a new qualifier "native" vs. "dbapi" unicode to avoid
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
2016-01-24 18:28:09 -05:00
Mike Bayer f9679710f1 - set explicit encoding settings for default mysql driver 2015-11-21 17:01:25 -05:00
Mike Bayer a826ff366b - additional test adjustments for pypy / psycopg2cffi. This
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
2015-01-26 18:43:19 -05:00
Shaun Stanworth f94d75ede5 Added psycopg2cffi dialect 2015-01-26 18:43:19 -05:00
Mike Bayer 4a4cbe5ff2 - comment this out (again) 2014-09-17 13:12:41 -04:00
Mike Bayer be57def4b9 - repair get_foreign_table_names() for PGInsp/dialect level
- repair get_view_names()
- changelog + migration note
2014-09-17 13:11:22 -04:00
Mike Bayer 27617986bb keep this off for the moment as jenkins isn't set up for this yet 2014-09-17 12:41:55 -04:00
Rodrigo Menezes b3f7cd8bf4 Merge branch 'master' of https://github.com/zzzeek/sqlalchemy into feature/postgres-relkind 2014-08-26 12:57:00 -04:00
Mike Bayer 7fa5952214 - max failures 25
- guard against some potential pytest snarkiness
2014-08-16 13:33:02 -04:00
Rodrigo Menezes 649f06759d Added support for postgres_relkind. 2014-08-14 14:47:23 -04:00
Mike Bayer f84e8bc3fa add pg8000 2014-07-06 17:00:38 -04:00
Mike Bayer efd3c311e0 update 2014-03-30 21:09:33 -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
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 122ae49065 no more wheels until they have a point
fixes #2970
2014-02-22 21:39:14 -05:00
Mike Bayer 88c23b8df2 ill never remember this URL so put it here
e Please enter the commit message for your changes. Lines starting
2014-02-17 14:54:38 -05:00
Mike Bayer 7a9e8b2312 - this seems to be the best string for pymysql 2014-02-03 12:11:23 -05:00
Mike Bayer 8b08b1a35b - Fixed bug which prevented MySQLdb-based dialects (e.g.
pymysql) from working in Py3K, where a check for "connection
charset" would fail due to Py3K's more strict value comparison
rules.  The call in question  wasn't taking the database
version into account in any case as the server version was
still None at that point, so the method overall has been
simplified to rely upon connection.character_set_name().
[ticket:2933]
2014-02-03 12:04:51 -05:00
Mike Bayer 02a58b5112 do the wheel thing 2013-11-14 21:18:44 -05:00
Mike Bayer c2a158c137 - some tweaks to try to help out mssql+pyodbc support a bit, py3k is really
not happening too well (I need to stick with linux + freetds 0.91, I know)
2013-06-03 12:54:56 -04:00
Mike Bayer c7ce62cf65 - OK we have -w sql passing for: sqlite, postgresql, oursql 2.7 + 3.3, mysqldb 2.7 2013-05-04 15:26:28 -04:00
Mike Bayer 2a20fd85d7 - add pgp identity 2013-03-09 20:40:17 -05:00
Mike Bayer 70d38af42e Fixed table reflection for Oracle when accessing a synonym that refers
to a DBLINK remote database; while the syntax has been present in the
Oracle dialect for some time, up until now it has never been tested.
The syntax has been tested against a sample database linking to itself,
however there's still some uncertainty as to what should be used for the
"owner" when querying the remote database for table information.
Currently, the value of "username" from user_db_links is used to
match the "owner".  [ticket:2619]
2012-12-09 18:28:08 -05:00
Mike Bayer f84448ffea - add a runner module
- make "default" the default dialect.
2012-09-27 03:06:40 -04:00
Mike Bayer 20cdc64588 trying different approaches to test layout. in this one, the testing modules
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.
2012-09-27 02:37:33 -04:00
Mike Bayer 21cac5b598 - profile file is configurable 2012-09-26 19:15:09 -04:00
Mike Bayer 1a7778632d - further reorganization of test suite:
- bootstrap and lib move to all absolute imports
  - testing.py is no longer internally referenced.
  - requirements move to be a pluggable class which can
    be overridden.
  - cleanup

in the interests of third party testing, test/lib and test/bootstrap
may move to be an independent package.
2012-09-26 17:21:21 -04:00
Mike Bayer 67e0f356b2 - A TypeDecorator of Integer can be used with a primary key
column, and the "autoincrement" feature of various dialects
  as well as the "sqlite_autoincrement" flag will honor
  the underlying database type as being Integer-based.
 [ticket:2005]

- Result-row processors are applied to pre-executed SQL
  defaults, as well as cursor.lastrowid, when determining
  the contents of result.inserted_primary_key.
  [ticket:2006]

- Bind parameters present in the "columns clause" of a select
  are now auto-labeled like other "anonymous" clauses,
  which among other things allows their "type" to be meaningful
  when the row is fetched, as in result row processors.

- TypeDecorator is present in the "sqlalchemy" import space.
2011-01-11 15:22:46 -05:00
Mike Bayer 58b2939433 - sqlalchemy.test and nose plugin moves back to being entirely
outside of "sqlalchemy" and under "test/".

Rationale:

- coverage plugin works without issue, without need for an awkward
additional package install
- command line for "nosetests" isn't polluted with SQLAlchemy options

[ticket:1949]
2010-11-28 14:19:44 -05:00
Mike Bayer 333a46ee84 dont need the svn_revision flag anymore 2010-03-20 12:29:52 -04:00
Michael Trier d050991944 Modified unittests docs to explain that --first-package-wins=True is required on Windows. Also modified the setup.cfg to add this option so that if using the default config there will be consistent behavior on all platforms. 2010-02-23 00:27:34 +00:00
Mike Bayer 40f8aadd58 - mega example cleanup
- added READMEs to all examples in each __init__.py and added to sphinx documentation
- added versioning example
- removed vertical/vertical.py, the dictlikes are more straightforward
2010-01-19 00:53:12 +00:00
Michael Trier 9ac6f28996 Reverted my screw up of setup.cfg 2009-07-28 01:23:17 +00:00
Michael Trier 6a67cb17c3 Corrected examples tests. I was running from ./test instead of root. 2009-07-28 01:20:52 +00:00