diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-01-17 17:31:41 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-01-17 17:44:57 -0500 |
| commit | 9e31fc74089cf565df5f275d22eb8ae5414d6e45 (patch) | |
| tree | 954edc3ebcc2116e388752e4aa53789e04113a23 /lib/sqlalchemy/testing | |
| parent | a711522650863dd368acfa90e09216ae37fc3ec2 (diff) | |
| download | sqlalchemy-9e31fc74089cf565df5f275d22eb8ae5414d6e45.tar.gz | |
Remove jython code, remove all jython / pypy symbols
Removed all dialect code related to support for Jython and zxJDBC. Jython
has not been supported by SQLAlchemy for many years and it is not expected
that the current zxJDBC code is at all functional; for the moment it just
takes up space and adds confusion by showing up in documentation. At the
moment, it appears that Jython has achieved Python 2.7 support in its
releases but not Python 3. If Jython were to be supported again, the form
it should take is against the Python 3 version of Jython, and the various
zxJDBC stubs for various backends should be implemented as a third party
dialect.
Additionally modernized logic that distinguishes between "cpython"
and "pypy" to instead look at platform.python_distribution() which
reliably tells us if we are cPython or not; all booleans which
previously checked for pypy and sometimes jython are now converted
to be "not cpython", this impacts the test suite for tests that are
cPython centric.
Fixes: #5094
Change-Id: I226cb55827f997daf6b4f4a755c18e7f4eb8d9ad
Diffstat (limited to 'lib/sqlalchemy/testing')
| -rw-r--r-- | lib/sqlalchemy/testing/engines.py | 2 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/profiling.py | 14 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/requirements.py | 2 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_insert.py | 4 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/util.py | 22 |
5 files changed, 13 insertions, 31 deletions
diff --git a/lib/sqlalchemy/testing/engines.py b/lib/sqlalchemy/testing/engines.py index 4aa5560bf..ff4f89606 100644 --- a/lib/sqlalchemy/testing/engines.py +++ b/lib/sqlalchemy/testing/engines.py @@ -58,7 +58,7 @@ class ConnectionKiller(object): # this can cause a deadlock with pg8000 - pg8000 acquires # prepared statement lock inside of rollback() - if async gc # is collecting in finalize_fairy, deadlock. - # not sure if this should be if pypy/jython only. + # not sure if this should be for non-cpython only. # note that firebird/fdb definitely needs this though for conn, rec in list(self.conns): if rec.connection is None: diff --git a/lib/sqlalchemy/testing/profiling.py b/lib/sqlalchemy/testing/profiling.py index 14a6fc4ac..cc6557018 100644 --- a/lib/sqlalchemy/testing/profiling.py +++ b/lib/sqlalchemy/testing/profiling.py @@ -15,13 +15,13 @@ in a more fine-grained way than nose's profiling plugin. import collections import contextlib import os +import platform import pstats import sys from . import config from .util import gc_collect -from ..util import jython -from ..util import pypy +from ..util import cpython from ..util import win32 @@ -91,12 +91,12 @@ class ProfileStatsFile(object): # keep it at 2.7, 3.1, 3.2, etc. for now. py_version = ".".join([str(v) for v in sys.version_info[0:2]]) - platform_tokens = [py_version] + if not cpython: + platform_tokens = [platform.python_implementation(), py_version] + else: + platform_tokens = [py_version] platform_tokens.append(dbapi_key) - if jython: - platform_tokens.append("jython") - if pypy: - platform_tokens.append("pypy") + if win32: platform_tokens.append("win") platform_tokens.append( diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index 4088c0cb1..b3375f6d5 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -1034,7 +1034,7 @@ class SuiteRequirements(Requirements): from sqlalchemy.util import pickle return exclusions.only_if( - lambda: not util.pypy + lambda: util.cpython and pickle.__name__ == "cPickle" or sys.version_info >= (3, 2), "Needs cPickle+cPython or newer Python 3 pickle", diff --git a/lib/sqlalchemy/testing/suite/test_insert.py b/lib/sqlalchemy/testing/suite/test_insert.py index fc535aa23..2cc8761b8 100644 --- a/lib/sqlalchemy/testing/suite/test_insert.py +++ b/lib/sqlalchemy/testing/suite/test_insert.py @@ -56,10 +56,6 @@ class LastrowidTest(fixtures.TablesTest): pk = config.db.scalar(select([self.tables.autoinc_pk.c.id])) eq_(r.inserted_primary_key, [pk]) - # failed on pypy1.9 but seems to be OK on pypy 2.1 - # @exclusions.fails_if(lambda: util.pypy, - # "lastrowid not maintained after " - # "connection close") @requirements.dbapi_lastrowid def test_native_lastrowid_autoinc(self): r = config.db.execute( diff --git a/lib/sqlalchemy/testing/util.py b/lib/sqlalchemy/testing/util.py index de20bb794..c52dc4a19 100644 --- a/lib/sqlalchemy/testing/util.py +++ b/lib/sqlalchemy/testing/util.py @@ -9,36 +9,22 @@ import decimal import gc import random import sys -import time import types from . import mock from ..util import decorator from ..util import defaultdict +from ..util import has_refcount_gc from ..util import inspect_getfullargspec -from ..util import jython from ..util import py2k -from ..util import pypy -if jython: +if not has_refcount_gc: - def jython_gc_collect(*args): - """aggressive gc.collect for tests.""" - gc.collect() - time.sleep(0.1) - gc.collect() - gc.collect() - return 0 - - # "lazy" gc, for VM's that don't GC on refcount == 0 - gc_collect = lazy_gc = jython_gc_collect -elif pypy: - - def pypy_gc_collect(*args): + def non_refcount_gc_collect(*args): gc.collect() gc.collect() - gc_collect = lazy_gc = pypy_gc_collect + gc_collect = lazy_gc = non_refcount_gc_collect else: # assume CPython - straight gc.collect, lazy_gc() is a pass gc_collect = gc.collect |
