summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-01-17 17:31:41 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2020-01-17 17:44:57 -0500
commit9e31fc74089cf565df5f275d22eb8ae5414d6e45 (patch)
tree954edc3ebcc2116e388752e4aa53789e04113a23 /test
parenta711522650863dd368acfa90e09216ae37fc3ec2 (diff)
downloadsqlalchemy-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 'test')
-rw-r--r--test/aaa_profiling/test_pool.py4
-rw-r--r--test/base/test_utils.py17
-rw-r--r--test/dialect/oracle/test_types.py3
-rw-r--r--test/dialect/postgresql/test_dialect.py9
-rw-r--r--test/dialect/postgresql/test_query.py2
-rw-r--r--test/dialect/postgresql/test_types.py26
-rw-r--r--test/engine/test_execute.py3
-rw-r--r--test/engine/test_transaction.py4
-rw-r--r--test/ext/test_extendedattr.py2
-rw-r--r--test/orm/test_deprecations.py4
-rw-r--r--test/orm/test_froms.py5
-rw-r--r--test/orm/test_instrumentation.py2
-rw-r--r--test/requirements.py20
-rw-r--r--test/sql/test_returning.py1
14 files changed, 18 insertions, 84 deletions
diff --git a/test/aaa_profiling/test_pool.py b/test/aaa_profiling/test_pool.py
index 07438f880..d74dcf627 100644
--- a/test/aaa_profiling/test_pool.py
+++ b/test/aaa_profiling/test_pool.py
@@ -21,8 +21,8 @@ class QueuePoolTest(fixtures.TestBase, AssertsExecutionResults):
def teardown(self):
# the tests leave some fake connections
# around which don't necessarily
- # get gc'ed as quickly as we'd like,
- # on backends like pypy, python3.2
+ # get gc'ed as quickly as we'd like all the time,
+ # particularly for non-refcount gc
pool_module._refs.clear()
def setup(self):
diff --git a/test/base/test_utils.py b/test/base/test_utils.py
index e4d5a4d5f..1f7c0cf62 100644
--- a/test/base/test_utils.py
+++ b/test/base/test_utils.py
@@ -15,7 +15,6 @@ from sqlalchemy.testing import assert_raises
from sqlalchemy.testing import assert_raises_message
from sqlalchemy.testing import eq_
from sqlalchemy.testing import expect_warnings
-from sqlalchemy.testing import fails_if
from sqlalchemy.testing import fixtures
from sqlalchemy.testing import in_
from sqlalchemy.testing import is_
@@ -2060,13 +2059,13 @@ class ArgInspectionTest(fixtures.TestBase):
),
)
- @fails_if(lambda: util.pypy, "pypy returns plain *arg, **kw")
+ @testing.requires.cpython
def test_callable_argspec_py_builtin(self):
import datetime
assert_raises(TypeError, get_callable_argspec, datetime.datetime.now)
- @fails_if(lambda: util.pypy, "pypy returns plain *arg, **kw")
+ @testing.requires.cpython
def test_callable_argspec_obj_init(self):
assert_raises(TypeError, get_callable_argspec, object)
@@ -2148,7 +2147,7 @@ class ArgInspectionTest(fixtures.TestBase):
compat.FullArgSpec(["x", "y"], None, None, None, [], None, {}),
)
- @fails_if(lambda: util.pypy, "pypy returns plain *arg, **kw")
+ @testing.requires.cpython
def test_callable_argspec_partial(self):
from functools import partial
@@ -2495,10 +2494,7 @@ class TestFormatArgspec(_Py3KFixtures, fixtures.TestBase):
grouped=False,
)
- @testing.fails_if(
- lambda: util.pypy,
- "pypy doesn't report Obj.__init__ as object.__init__",
- )
+ @testing.requires.cpython
def test_init_grouped(self):
object_spec = {
"args": "(self)",
@@ -2522,10 +2518,7 @@ class TestFormatArgspec(_Py3KFixtures, fixtures.TestBase):
self._test_init(None, object_spec, wrapper_spec, custom_spec)
self._test_init(True, object_spec, wrapper_spec, custom_spec)
- @testing.fails_if(
- lambda: util.pypy,
- "pypy doesn't report Obj.__init__ as object.__init__",
- )
+ @testing.requires.cpython
def test_init_bare(self):
object_spec = {
"args": "self",
diff --git a/test/dialect/oracle/test_types.py b/test/dialect/oracle/test_types.py
index b3bde1c7f..23c73a231 100644
--- a/test/dialect/oracle/test_types.py
+++ b/test/dialect/oracle/test_types.py
@@ -275,9 +275,6 @@ class TypesTest(fixtures.TestBase):
)
eq_(conn.execute(s3).fetchall(), [(5, rowid)])
- @testing.fails_on(
- "+zxjdbc", "Not yet known how to pass values of the " "INTERVAL type"
- )
@testing.provide_metadata
def test_interval(self):
metadata = self.metadata
diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py
index cf33f7cbb..107f3a9b2 100644
--- a/test/dialect/postgresql/test_dialect.py
+++ b/test/dialect/postgresql/test_dialect.py
@@ -584,7 +584,8 @@ class MiscBackendTest(
@testing.requires.psycopg2_compatibility
def test_psycopg2_non_standard_err(self):
- # under pypy the name here is psycopg2cffi
+ # note that psycopg2 is sometimes called psycopg2cffi
+ # depending on platform
psycopg2 = testing.db.dialect.dbapi
TransactionRollbackError = __import__(
"%s.extensions" % psycopg2.__name__
@@ -670,11 +671,6 @@ $$ LANGUAGE plpgsql;
"commit prepared 'gilberte'",
)
- @testing.fails_on(
- "+zxjdbc",
- "Can't infer the SQL type to use for an instance "
- "of org.python.core.PyObjectDerived.",
- )
def test_extract(self):
fivedaysago = testing.db.scalar(
select([func.now()])
@@ -784,7 +780,6 @@ $$ LANGUAGE plpgsql;
finally:
testing.db.execute("drop table speedy_users")
- @testing.fails_on("+zxjdbc", "psycopg2/pg8000 specific assertion")
@testing.requires.psycopg2_or_pg8000_compatibility
def test_numeric_raise(self):
stmt = text("select cast('hi' as char) as hi").columns(hi=Numeric)
diff --git a/test/dialect/postgresql/test_query.py b/test/dialect/postgresql/test_query.py
index cf51104d8..65defea80 100644
--- a/test/dialect/postgresql/test_query.py
+++ b/test/dialect/postgresql/test_query.py
@@ -751,7 +751,6 @@ class MatchTest(fixtures.TestBase, AssertsCompiledSQL):
metadata.drop_all()
@testing.fails_on("postgresql+pg8000", "uses positional")
- @testing.fails_on("postgresql+zxjdbc", "uses qmark")
def test_expression_pyformat(self):
self.assert_compile(
matchtable.c.title.match("somstr"),
@@ -761,7 +760,6 @@ class MatchTest(fixtures.TestBase, AssertsCompiledSQL):
@testing.fails_on("postgresql+psycopg2", "uses pyformat")
@testing.fails_on("postgresql+pypostgresql", "uses pyformat")
@testing.fails_on("postgresql+pygresql", "uses pyformat")
- @testing.fails_on("postgresql+zxjdbc", "uses qmark")
@testing.fails_on("postgresql+psycopg2cffi", "uses pyformat")
def test_expression_positional(self):
self.assert_compile(
diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py
index 6bcfb1736..6a61fb33b 100644
--- a/test/dialect/postgresql/test_types.py
+++ b/test/dialect/postgresql/test_types.py
@@ -95,10 +95,6 @@ class FloatCoercionTest(fixtures.TablesTest, AssertsExecutionResults):
{"data": 9},
)
- @testing.fails_on(
- "postgresql+zxjdbc",
- "XXX: postgresql+zxjdbc currently returns a Decimal result for Float",
- )
def test_float_coercion(self):
data_table = self.tables.data_table
@@ -119,9 +115,6 @@ class FloatCoercionTest(fixtures.TablesTest, AssertsExecutionResults):
).scalar()
eq_(round_decimal(ret, 9), result)
- @testing.fails_on(
- "postgresql+zxjdbc", "zxjdbc has no support for PG arrays"
- )
@testing.provide_metadata
def test_arrays_pg(self):
metadata = self.metadata
@@ -138,9 +131,6 @@ class FloatCoercionTest(fixtures.TablesTest, AssertsExecutionResults):
row = t1.select().execute().first()
eq_(row, ([5], [5], [6], [decimal.Decimal("6.4")]))
- @testing.fails_on(
- "postgresql+zxjdbc", "zxjdbc has no support for PG arrays"
- )
@testing.provide_metadata
def test_arrays_base(self):
metadata = self.metadata
@@ -163,11 +153,6 @@ class EnumTest(fixtures.TestBase, AssertsExecutionResults):
__only_on__ = "postgresql > 8.3"
- @testing.fails_on(
- "postgresql+zxjdbc",
- 'zxjdbc fails on ENUM: column "XXX" is of type '
- "XXX but expression is of type character varying",
- )
@testing.provide_metadata
def test_create_table(self):
metadata = self.metadata
@@ -198,11 +183,6 @@ class EnumTest(fixtures.TestBase, AssertsExecutionResults):
exc.CompileError, etype.compile, dialect=postgresql.dialect()
)
- @testing.fails_on(
- "postgresql+zxjdbc",
- 'zxjdbc fails on ENUM: column "XXX" is of type '
- "XXX but expression is of type character varying",
- )
@testing.provide_metadata
def test_unicode_labels(self):
metadata = self.metadata
@@ -842,10 +822,6 @@ class TimezoneTest(fixtures.TestBase):
def teardown_class(cls):
metadata.drop_all()
- @testing.fails_on(
- "postgresql+zxjdbc",
- "XXX: postgresql+zxjdbc doesn't give a tzinfo back",
- )
def test_with_timezone(self):
# get a date with a tzinfo
@@ -1201,7 +1177,7 @@ class ArrayRoundTripTest(object):
__only_on__ = "postgresql"
__backend__ = True
- __unsupported_on__ = "postgresql+pg8000", "postgresql+zxjdbc"
+ __unsupported_on__ = ("postgresql+pg8000",)
ARRAY = postgresql.ARRAY
diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py
index b71eb8837..2c6473166 100644
--- a/test/engine/test_execute.py
+++ b/test/engine/test_execute.py
@@ -105,7 +105,7 @@ class ExecuteTest(fixtures.TestBase):
eq_(result, "%")
@testing.fails_on_everything_except(
- "firebird", "sqlite", "+pyodbc", "+mxodbc", "+zxjdbc", "mysql+oursql"
+ "firebird", "sqlite", "+pyodbc", "+mxodbc", "mysql+oursql"
)
def test_raw_qmark(self):
def go(conn):
@@ -172,7 +172,6 @@ class ExecuteTest(fixtures.TestBase):
"mysql+mysqlconnector",
"postgresql",
)
- @testing.fails_on("postgresql+zxjdbc", "sprintf not supported")
def test_raw_sprintf(self):
def go(conn):
conn.execute(
diff --git a/test/engine/test_transaction.py b/test/engine/test_transaction.py
index 595849bd5..39c9b2ad4 100644
--- a/test/engine/test_transaction.py
+++ b/test/engine/test_transaction.py
@@ -374,10 +374,6 @@ class TransactionTest(fixtures.TestBase):
connection.close()
@testing.requires.savepoints
- @testing.crashes(
- "oracle+zxjdbc",
- "Errors out and causes subsequent tests to " "deadlock",
- )
def test_nested_subtransaction_commit(self):
connection = testing.db.connect()
transaction = connection.begin()
diff --git a/test/ext/test_extendedattr.py b/test/ext/test_extendedattr.py
index 46df83a30..df9d2f9d5 100644
--- a/test/ext/test_extendedattr.py
+++ b/test/ext/test_extendedattr.py
@@ -109,7 +109,7 @@ class UserDefinedExtensionTest(_ExtBase, fixtures.ORMTest):
)
# This proves SA can handle a class with non-string dict keys
- if not util.pypy and not util.jython:
+ if util.cpython:
locals()[42] = 99 # Don't remove this line!
def __init__(self, **kwargs):
diff --git a/test/orm/test_deprecations.py b/test/orm/test_deprecations.py
index 6b423d03f..17954f308 100644
--- a/test/orm/test_deprecations.py
+++ b/test/orm/test_deprecations.py
@@ -46,7 +46,6 @@ from sqlalchemy.testing import is_true
from sqlalchemy.testing.schema import Column
from sqlalchemy.testing.schema import Table
from sqlalchemy.testing.util import gc_collect
-from sqlalchemy.util.compat import pypy
from . import _fixtures
from .inheritance import _poly_fixtures
from .test_options import PathTest as OptionsPathTest
@@ -343,8 +342,7 @@ class StrongIdentityMapTest(_fixtures.FixtureTest):
def test_prune_events(self):
self._test_prune(self._event_fixture)
- @testing.fails_if(lambda: pypy, "pypy has a real GC")
- @testing.fails_on("+zxjdbc", "http://www.sqlalchemy.org/trac/ticket/1473")
+ @testing.requires.cpython
def _test_prune(self, fixture):
s, prune = fixture()
diff --git a/test/orm/test_froms.py b/test/orm/test_froms.py
index f3fda579a..54714864d 100644
--- a/test/orm/test_froms.py
+++ b/test/orm/test_froms.py
@@ -1507,11 +1507,6 @@ class MixedEntitiesTest(QueryTest, AssertsCompiledSQL):
"pg8000 parses the SQL itself before passing on "
"to PG, doesn't parse this",
)
- @testing.fails_on(
- "postgresql+zxjdbc",
- "zxjdbc parses the SQL itself before passing on "
- "to PG, doesn't parse this",
- )
@testing.fails_on("firebird", "unknown")
def test_values_with_boolean_selects(self):
"""Tests a values clause that works with select boolean
diff --git a/test/orm/test_instrumentation.py b/test/orm/test_instrumentation.py
index 5dea8d9d8..ddf735e4f 100644
--- a/test/orm/test_instrumentation.py
+++ b/test/orm/test_instrumentation.py
@@ -750,8 +750,6 @@ class MiscTest(fixtures.ORMTest):
assert instrumentation.manager_of_class(A) is None
assert not hasattr(A, "x")
- # I prefer 'is' here but on pypy
- # it seems only == works
assert A.__init__ == object.__init__
def test_compileonattr_rel_backref_a(self):
diff --git a/test/requirements.py b/test/requirements.py
index dceae6c54..47a84fc89 100644
--- a/test/requirements.py
+++ b/test/requirements.py
@@ -92,9 +92,9 @@ class DefaultRequirements(SuiteRequirements):
"""target database must *not* support ON UPDATE..CASCADE behavior in
foreign keys."""
- return fails_on_everything_except(
- "sqlite", "oracle", "+zxjdbc"
- ) + skip_if("mssql")
+ return fails_on_everything_except("sqlite", "oracle") + skip_if(
+ "mssql"
+ )
@property
def recursive_fk_cascade(self):
@@ -681,11 +681,6 @@ class DefaultRequirements(SuiteRequirements):
"sybase", "two-phase xact not supported by drivers/SQLA"
),
no_support(
- "postgresql+zxjdbc",
- "FIXME: JDBC driver confuses the transaction state, "
- "may need separate XA implementation",
- ),
- no_support(
"mysql",
"recent MySQL communiity editions have too many issues "
"(late 2016), disabling for now",
@@ -828,7 +823,6 @@ class DefaultRequirements(SuiteRequirements):
[
lambda config: against(config, "postgresql")
and not against(config, "+pg8000")
- and not against(config, "+zxjdbc")
]
)
@@ -915,9 +909,7 @@ class DefaultRequirements(SuiteRequirements):
"""target dialect supports representation of Python
datetime.datetime() with microsecond objects."""
- return skip_if(
- ["mssql", "mysql", "firebird", "+zxjdbc", "oracle", "sybase"]
- )
+ return skip_if(["mssql", "mysql", "firebird", "oracle", "sybase"])
@property
def timestamp_microseconds(self):
@@ -968,9 +960,7 @@ class DefaultRequirements(SuiteRequirements):
"""target dialect supports representation of Python
datetime.time() with microsecond objects."""
- return skip_if(
- ["mssql", "mysql", "firebird", "+zxjdbc", "oracle", "sybase"]
- )
+ return skip_if(["mssql", "mysql", "firebird", "oracle", "sybase"])
@property
def precision_numerics_general(self):
diff --git a/test/sql/test_returning.py b/test/sql/test_returning.py
index ad1eb3348..b8a3cce7c 100644
--- a/test/sql/test_returning.py
+++ b/test/sql/test_returning.py
@@ -97,7 +97,6 @@ class ReturningTest(fixtures.TestBase, AssertsExecutionResults):
@testing.fails_on(
"firebird", "fb/kintersbasdb can't handle the bind params"
)
- @testing.fails_on("oracle+zxjdbc", "JDBC driver bug")
def test_anon_expressions(self):
result = (
table.insert()