133 Commits

Author SHA1 Message Date
Federico Caselli 8849e2b775 use cython for result
Use cython for the internal result methods. This improves the speed
of the row processing of about 15-30% depending on cases.

Change-Id: Ia19c1a61aa1a55405b8327f88b1ee02627c4217a
2025-12-08 21:45:41 +01:00
Albert N 95ab6ed79c perf tuning of BaseRow
common cases are a bit faster overall

Python version
|                      | python opt | python main | py opt / main |
| -------------------- | ---------- | ----------- | ------------- |
| base_row_new         | 0.84959    | 0.86417     | 0.9831283197  |
| row_new              | 0.85698    | 0.85543     | 1.001811954   |
| base_row_new_proc    | 2.77489    | 2.81795     | 0.9847193882  |
| row_new_proc         | 2.77881    | 2.86206     | 0.9709125595  |
| brow_new_proc_none   | 1.6311     | 1.65773     | 0.9839358641  |
| row_new_proc_none    | 1.65048    | 1.69896     | 0.9714648962  |
| row_dumps            | 0.15279    | 0.14519     | 1.052345203   |
| row_loads            | 0.91471    | 0.91358     | 1.001236892   |
| row_values_impl      | 0.1818     | 0.17773     | 1.022899904   |
| row_iter             | 0.44042    | 0.4554      | 0.967105841   |
| row_len              | 0.13858    | 0.13079     | 1.059561129   |
| row_hash             | 0.28614    | 0.29172     | 0.9808720691  |
| getitem              | 0.23159    | 0.23138     | 1.000907598   |
| getitem_slice        | 0.38393    | 0.38765     | 0.9904037147  |
| get_by_key           | 0.33692    | 0.33913     | 0.993483325   |
| get_by_key2          | 0.35105    | 0.33915     | 1.035087719   |
| getattr              | 0.46809    | 0.46911     | 0.9978256699  |
| get_by_key_recreate  | 1.08137    | 1.18224     | 0.9146789146  |
| get_by_key_recreate2 | 0.98543    | 0.99272     | 0.9926565396  |
| getattr_recreate     | 0.74       | 0.7407      | 0.999054948   |
| contains             | 0.49312    | 0.74477     | 0.6621104502  |

Cython version
|                      | cython opt | cython main | cy opt / main |
| -------------------- | ---------- | ----------- | ------------- |
| base_row_new         | 0.12933    | 0.1347      | 0.9601336303  |
| row_new              | 0.15755    | 0.16489     | 0.9554854752  |
| base_row_new_proc    | 0.87398    | 1.08483     | 0.8056377497  |
| row_new_proc         | 0.88592    | 1.13255     | 0.7822347799  |
| brow_new_proc_none   | 0.2664     | 0.41703     | 0.6388029638  |
| row_new_proc_none    | 0.27526    | 0.42483     | 0.6479297601  |
| row_dumps            | 0.37526    | 0.20093     | 1.867615588   |
| row_loads            | 0.53037    | 0.3607      | 1.470390907   |
| row_values_impl      | 0.36886    | 0.22218     | 1.660185435   |
| row_iter             | 0.25249    | 0.25553     | 0.9881031581  |
| row_len              | 0.05194    | 0.05412     | 0.9597191426  |
| row_hash             | 0.18864    | 0.18726     | 1.007369433   |
| getitem              | 0.13876    | 0.13934     | 0.9958375197  |
| getitem_slice        | 0.23181    | 0.2318      | 1.000043141   |
| get_by_key           | 0.17031    | 0.17857     | 0.9537436299  |
| get_by_key2          | 0.58172    | 0.31651     | 1.837919813   |
| getattr              | 0.21275    | 1.16669     | 0.1823534958  |
| get_by_key_recreate  | 0.80161    | 0.8836      | 0.9072091444  |
| get_by_key_recreate2 | 1.14649    | 0.98709     | 1.161484768   |
| getattr_recreate     | 0.55927    | 1.09921     | 0.5087926784  |
| contains             | 0.35338    | 0.5494      | 0.6432107754  |

Closes: #12919
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12919
Pull-request-sha: b13204b741

Change-Id: I5ff2b951f9840e99abdad3ae286ecb8becc70e4b
2025-11-13 23:59:59 +01:00
Lysandros Nikolaou 456727df50 Add explicit multi-threaded tests and support free-threaded build
Implemented initial support for free-threaded Python by adding new tests
and reworking the test harness and GitHub Actions to include Python 3.13t
and Python 3.14t in test runs. Two concurrency issues have been identified
and fixed: the first involves initialization of the ``.c`` collection on a
``FromClause``, a continuation of 🎫`12302`, where an optional mutex
under free-threading is added; the second involves synchronization of the
pool "first_connect" event, which first received thread synchronization in
🎫`2964`, however under free-threading the creation of the mutex
itself runs under the same free-threading mutex. Initial pull request and
test suite courtesy Lysandros Nikolaou.

py313t: yes
py314t: yes
Fixes: #12881
Closes: #12882
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12882
Pull-request-sha: 53d65d96b9

Co-authored-by: Mike Bayer <mike_mp@zzzcomputng.com>
Change-Id: I2e4f2e9ac974ab6382cb0520cc446b396d9680a6
2025-10-02 12:14:28 -04:00
Federico Caselli 0be89aaa38 Switch to cython pure python mode
Replaces the pyx files with py files that can be both compiled
by cython or imported as is by python.
This avoids the need of duplicating the code to have a python
only fallback.
The cython files are also reorganized to be in the module they use
instead of all being in the cyextension package, that has been
removed.

The performance is pretty much equal between main and this change.
A detailed comparison is at this link
https://docs.google.com/spreadsheets/d/1jkmGpnCyEcPyy6aRK9alElGjxlNHu44Wxjr4VrD99so/edit?usp=sharing

Change-Id: Iaed232ea5dfb41534cc9f58f6ea2f912a93263af
2024-03-25 23:44:27 +01:00
Federico Caselli 058c230cea Update black to v23.3.0 and flake8 to v6
This change could be added to .git-blame-ignore-revs

Change-Id: I7ba10052b26bc3c178d23fb50a1123d0aae965ca
2023-05-30 21:44:26 +02:00
Federico Caselli 741534d840 Improve compiled extension detection
Ensure that all cython extension are imported by the compied detection logic.
This is required since cython extensions moduels are marked as optional
in the install, so it's possible that only some of them are compiled.
The extensions are enabled only if all of them are correctly compiled

Change-Id: I355cbac06f5c7a47d35661f42ebab3b0156c1965
2022-09-05 22:32:14 +02:00
Federico Caselli 282d86d108 Mark extension modules as optional
This greatly simplifies the setup.py file and makes it compatible with
setuptools 64+ change to editable install.

Change-Id: I16a776b175bcf67e26f4bbb8f80b1b473f585e2a
2022-09-01 18:21:41 -04:00
Trevor Gross 7b67920fcb Use cibuildwheel to create wheels
Using cibuildwheel the following wheels are created:
- windows x64 and x84
- macos x64 and arm
- linux x64 and arm on manylinux and mosulinux (for alpine)
- create a pure python wheel (for pypy and other archs)

Fixes: #6702
Fixes: #7607
Closes: #7992
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7992
Pull-request-sha: 61d5e24e5b

Change-Id: If0c0b353766e0b61d421789d619eb2b940c08ad0
2022-08-29 17:21:51 +00:00
Federico Caselli c87a08ed8f Fix AttributeError typo in setup.py that prevented fallback
pure python build if the compilation fails

Fixes: #7539
Change-Id: I4bf7905eb7a5337213ce922d005d2fffb8b9079c
2022-01-05 20:33:09 +00:00
Federico Caselli 76fa211620 Replace c extension with cython versions.
Re-implement c version immutabledict / processors / resultproxy / utils with cython.
Performance is in general in par or better than the c version
Added a collection module that has cython version of OrderedSet and IdentitySet

Added a new test/perf file to compare the implementations.
Run ``python test/perf/compiled_extensions.py all`` to execute the comparison test.

See results here: https://docs.google.com/document/d/1nOcDGojHRtXEkuy4vNXcW_XOJd9gqKhSeALGG3kYr6A/edit?usp=sharing

Fixes: #7256
Change-Id: I2930ef1894b5048210384728118e586e813f6a76
Signed-off-by: Federico Caselli <cfederico87@gmail.com>
2021-12-17 21:29:05 +01:00
Mike Bayer e6c02c3372 favor setuptools imports over distutils
Python 3.10 has deprecated "distutils" in favor of explicit use of
"setuptools" in :pep:`632`; SQLAlchemy's setup.py has replaced imports
accordingly. However, since setuptools itself only recently added the
replacement symbols mentioned in pep-632 as of November of 2022 in version
59.0.1, ``setup.py`` still has fallback imports to distutils, as SQLAlchemy
1.4 does not have a hard setuptools versioning requirement at this time.
SQLAlchemy 2.0 is expected to use a full :pep:`517` installation layout
which will indicate appropriate setuptools versioning up front.

Fixes: #7311
Change-Id: I215ef3c3b226a38266f59d181214aea462c4664d
2021-11-17 17:52:47 -05:00
Federico Caselli 629273a31b Minor optimization to the code
* remove the c version of distill params since it's actually slower than
the python one
* add a function to langhelpers to check if the cextensions are active
* minor cleanup to the OrderedSet implementation

Change-Id: Iec3d0c3f0f42cdf51f802aaca342ba37b8783b85
2021-02-18 20:37:22 +01:00
Mike Bayer e3fbbf830f Repair incorrect symbol PyDict_GetItemWithError for Python 2
* ensure on python 2 correct cflags to fail on undefined
symbols take effect

* fail for implicit function declaration

* python 2 does not publish PyDict_GetItemWithError but has
it as _PyDict_GetItemWIthError but only as of Python 2.7.12

Change-Id: I007509afddf7f44ca64e52fa9140be39f815fa7a
2021-01-27 13:08:01 -05:00
Mike Bayer cd03b8f0ce Use importlib_metadata; add namespace for mariadb
The ``importlib_metadata`` library is used to scan for setuptools
entrypoints rather than pkg_resources.   as importlib_metadata is a small
library that is included as of Python 3.8, the compatibility library is
installed as a dependency for Python versions older than 3.8.

Unfortunately setuptools "attr:" is broken because it tries to import
the module; seems like this is fixed as part of
https://github.com/pypa/setuptools/pull/1753 however this is too recent
to rely upon for now.

Added a new dialect token "mariadb" that may be used in place of "mysql" in
the :func:`_sa.create_engine` URL.  This will deliver a MariaDB dialect
subclass of the MySQLDialect in use that forces the "is_mariadb" flag to
True.  The dialect will raise an error if a server version string that does
not indicate MariaDB in use is received.   This is useful for
MariaDB-specific testing scenarios as well as to support applications that
are hardcoding to MariaDB-only concepts.  As MariaDB and MySQL featuresets
and usage patterns continue to diverge, this pattern may become more
prominent.

Fixes: #5400
Fixes: #5496
Change-Id: I330815ebe572b6a9818377da56621397335fa702
2020-08-13 14:25:44 -04:00
Mike Bayer 9ca81f5f79 Move most setup options to setup.cfg
Installation has been modernized to use setup.cfg for most package
metadata.

Fixes: #5404
Change-Id: Id59c0c4e7f81eca89999d1f1f8b03c89835a09d1
2020-06-19 12:31:33 -04:00
Mike Bayer fcbd03e48a Add immutabledict C code
Start trying to convert fundamental objects to
C as we now rely on a fairly small core of things,
and 1.4 is having problems with complexity added being
slower than the performance gains we are trying to build in.

immutabledict here does seem to bench as twice as fast as the
Python one, see below.  However, it does not appear to be
used prominently enough to make any dent in the performance
tests.

at the very least it may provide us some more lift-and-copy
code for more C extensions.

import timeit

from sqlalchemy.util._collections import not_immutabledict, immutabledict

def run(dict_cls):
    for i in range(1000000):
        d1 = dict_cls({"x": 5, "y": 4})

        d2 = d1.union({"x": 17, "new key": "some other value"}, None)

        assert list(d2) == ["x", "y", "new key"]

print(
    timeit.timeit(
        "run(d)", "from __main__ import run, not_immutabledict as d", number=1
    )
)
print(
    timeit.timeit(
        "run(d)", "from __main__ import run, immutabledict as d", number=1
    )
)

output:

python: 1.8799766399897635
C code: 0.8880784640205093

Change-Id: I29e7104dc21dcc7cdf895bf274003af2e219bf6d
2020-05-23 00:05:13 -04:00
Federico Caselli 4bd4b483e0 Remove support for python 3.4
Also remove no longer used compat code

Change-Id: Ifda239fd84b425e43f4028cb55a5b3b8efa4dfc6
2020-03-30 00:35:33 +02:00
Federico Caselli 5b6a1a9890 Fix typo in resultproxy.c and test compatibility with python 3.5
- Fix typo in resultproxy.c that would error on windows.
- add -Wundef to C flags when linux is detected so that undefined
symbols emit a warning
- a few adjustments for tests to succeed on python 3.5
- note minimum version still documented here as 3.4 but this should
move to at least 3.5 if not 3.6 for SQLAlchemy 1.4

Change-Id: Ia93ee1cb5c52e51e72eb0a24c100421c5157d04b
2020-03-28 13:23:12 -04:00
Gord Thompson 9a7c65c908 Add py3.8, py3.9 token to setup.py
Fixes: #5113

<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
Add py3.8 and py3.9 tokens to setup.py

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
	- Good to go, no issue or tests are needed
- [x] A short code fix
	- please include the issue number, and create an issue if none exists, which
	  must include a complete example of the issue.  one line code fixes without an
	  issue and demonstration will not be accepted.
	- Please include: `Fixes: #<issue number>` in the commit message
	- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
	- please include the issue number, and create an issue if none exists, which must
	  include a complete example of how the feature would look.
	- Please include: `Fixes: #<issue number>` in the commit message
	- please include tests.

**Have a nice day!**

Closes: #5115
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5115
Pull-request-sha: 5ae662f1ec

Change-Id: I1313df9bd117b1356c1d06d588e8e04a07ba4e39
2020-01-27 16:49:28 -05:00
Mike Bayer a54a0c6ec7 Fix cext for Python 2; ensure C extensions build successfully
The C extensions have been broken since cc718cccc0
however CI did not find this, because the build degraded to
non-C extensions without failing.   Ensure that if cext is set,
there is no fallback to non-cext build if the C extension build
fails.

Repair C related issues introduced in cc718cccc0.

As C extensions have been silently failing on 2.7 for some commits,
the callcounts also needed to be adjusted for recent performance-related
changes.  That in turn required a fix to the profiling decorator
to use signature rewriting in order to support py.test's
fixture mechanism under Python 2, usage introduced under profiling
in 89bf6d80a9.

Fixes: #5076
Change-Id: Id968f10c85d6bf489298b1c318a1f869ad3e7d80
2020-01-04 00:25:07 -05:00
Mike Bayer 4a2dd4902a Work around setuptools issue #1902
Added a workaround for a setuptools-related failure that has been observed
as occurring on Windows installations, where setuptools is not correctly
reporting a build error when the MSVC build dependencies are not installed
and therefore not allowing graceful degradation into non C extensions
builds.

Setuptools issue https://github.com/pypa/setuptools/issues/1902

Fixes: #4967
Change-Id: I5e21e7e78cb6d927b18afce64cacf8643b98354e
2019-11-08 11:24:26 -05:00
Mike Bayer c312b3b2de Remove python setup.py test; fix SQL Server URL
general README.unittest.rst edits

Fixes: #4789
Fixes: #4900
Change-Id: Ifddd3bfd1e6a4d24d3b0a3e1702e04e66a42a4dd
2019-10-28 14:58:47 -04:00
Mike Bayer fff65b814a Reformat license name
While we have the OSI classifier for "MIT License", it looks
like for the "license" field, this is normally just the word
"MIT" and not "MIT License".   While the pypa docs suggest we
only need it as the OSI classifier, keep it also in "license"
in order to appease common tooling.

Change-Id: Ife51bbc74d6c1b8ab9a736024818fbba35316e17
2019-05-28 09:46:20 -04:00
Mike Bayer 9feec16b14 Add documentation / tracker URLs for pypi
Change-Id: I379b3d9e59ff8cda17c2d738fde794249f105510
2019-05-27 17:26:35 -04:00
Mike Bayer 1e278de4cc Post black reformatting
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
2019-01-06 18:23:11 -05:00
Mike Bayer 1e1a38e780 Run black -l 79 against all source files
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
2019-01-06 17:34:50 +00:00
Mike Bayer 404e69426b Assorted pre-Black fixes
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
2019-01-05 23:51:34 -05:00
Mike Bayer 664290ab54 - block py.test 3.9.1 and 3.9.2, 3.9.3 is OK
Change-Id: I35ecd78b92ea420ef7909de65f82e005b92bf986
2018-11-02 16:54:21 -04:00
Mike Bayer 580d114405 Pin pytest *before* 3.9.1 totally
Unfortunately they have released
3.9.2 before fixing issue 4181, which means we will have to
re-pin a third time after they eventually release with
a fix

Change-Id: I9b6fab1b535f883a035f002264c41ad0166790ab
Reference: https://github.com/pytest-dev/pytest/issues/4181
2018-10-24 09:09:32 -04:00
Mike Bayer b4d42a84e2 block py.test 3.9.1
references:

https://github.com/pytest-dev/pytest/issues/4181

Change-Id: I216fde19dd0f5c4910d76c08400f2329b09ad584
2018-10-17 11:49:47 -04:00
Hugo fb9f4c4d44 Add python_requires and update classifiers
- bump minimum Python 3 version to 3.4 in docs
- set up setup.py classifiers to cover 2.7, 3.4, 3.5, 3.6, 3.7 explicitly
- add python_requires

These are also the ones supported by the core Python team.
https://en.wikipedia.org/wiki/CPython#Version_history

Change-Id: I2ffa632c73c39bf38ba9d8b5dcc86d552b61aa68
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/468
2018-08-26 13:53:37 -04:00
Alex Rothberg 5469dd1b8f Add postgresql_psycopg2binary install extra that installs psycopg2-binary
Fixes: #4306
Change-Id: I26edc1a4ac8a7f9f3f258bb03009ebfa4cc00e1a
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/465
2018-07-18 10:41:26 -04:00
Mike Bayer ef78334c0f Add oracle, mssql to profiling
As we are changing Oracle typing *again*, we should start tracking
if we trip over a big performance hit on the unicode stuff.

Change-Id: I72719cca4b9424171b32e1f2e58d655426e3bbba
2018-06-18 17:42:29 -04:00
Mike Bayer 2c594da214 Isolate memory tests in forks
Swing the biggest hammer, run multiprocessing.Process() for
each memusage test individually so that they are fully isolated
from the parent process and any side effects of pytest-xdist

Also add --nomemory as a shortcut to exclude_tags=memory-intensive
and add this to the setup.py test runner as the memory tests
should not be running for quick runs

Change-Id: I3c16c781e21b33deb939a64e77a6e0e41fb86922
2017-08-14 12:41:58 -04:00
Mike Bayer 1da9d37521 - bump minimum python version to 2.7
- add placeholder 1.2 release documentation, update intro numbers

Change-Id: I9f9969cbb9e95c2f750a5c16798e92c35a5ef6cf
2017-03-10 14:28:49 -05:00
Mike Bayer f2028dc5af - further changes to avoid pytest warnings
Change-Id: Ia83a996ff97a6ba54a0666a32241e570f3852ab4
2017-01-17 15:51:02 -05:00
Mark Sandan 42078107f1 update pytest good practices link in PyTest class
Change-Id: Ie96edd05e962663e9ddeeda85b24858caabd3bfd
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/262
2016-06-16 11:51:53 -04: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
Donald Stufft 39517d1046 Tell Wheel to generate platform and interpreter specific wheels
By telling wheel that we have extension modules, even though we
have none, wheel will create a Wheel which is platform and
interpreter specific. This will ensure that the pure Python wheels
on PyPy do not trigger installs on CPython without the C speedups.
2015-08-13 14:57:53 -04:00
Mike Bayer 44420423de - we can again use setuptools.find_packages since we require setuptools
- clean up other things we aren't using anymore
2015-08-13 14:48:18 -04:00
Mike Bayer 5ab9ab7940 - remove "distutils-only" mode, use setuptools only
- add first-class "pytest" runner to setup.py, fixes #3489
- remove references to setuptools Feature and mark that "--without-cextensions"
 is removed, fixes #3500
2015-07-24 18:52:25 -04:00
Mike Bayer 9554759642 - have python setup.py test use xdist with -q 2014-08-08 13:51:58 -04:00
Brian Jarrett 304e5b2a11 fixed style to conform to PEP8 2014-07-10 16:28:49 -06:00
Mike Bayer 99350b159f - Fixed bug where "python setup.py test" wasn't calling into
distutils appropriately, and errors would be emitted at the end
of the test suite.
2014-07-09 15:50:17 -04:00
Mike Bayer 56ef17e0f7 - we aren't supporting py2.5 so just simplify this import for platform, re: #2986 2014-03-22 17:49:35 -04:00
Mike Bayer ec97911ed9 - Adjusted `setup.py` file to support the possible future
removal of the ``setuptools.Feature`` extension from setuptools.
If this keyword isn't present, the setup will still succeed
with setuptools rather than falling back to distutils.  C extension
building can be disabled now also by setting the
DISABLE_SQLALCHEMY_CEXT environment variable.  This variable works
whether or not setuptools is even available. fixes #2986
- using platform.python_implementation() in setup.py to detect CPython.
I've tested this function on OSX and linux on Python 2.6 through 3.4,
including 3.1, 3.2, 3.3.
Unfortunately, on OSX + 3.2 only, it seems to segfault.  I've tried
installing 3.2.5 from the python.org .dmg, building it from source,
and also blew away the whole 3.2 directory, something seems to be wrong
with the "platform" module on that platform only, and there's also no
issue on bugs.python.org; however, I'm going with
it anyway. If someone is using 3.2 on OSX they really should be upgrading.
2014-03-22 17:31:50 -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 a6adc0a53e - The C extensions are ported to Python 3 and will build under
any supported CPython 2 or 3 environment. [ticket:2161]
2013-07-26 20:50:18 -04:00
Mike Bayer b38a76cd1d - replace most explicitly-named test objects called "Mock..." with
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.
2013-06-30 18:35:12 -04:00
Mike Bayer a5c9907d40 don't need 2to3 2013-04-28 15:01:26 -04:00