summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/suite
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2021-10-30 22:00:25 +0200
committerMike Bayer <mike_mp@zzzcomputing.com>2021-11-01 15:11:25 -0400
commit36e7aebd8d6faac77570403e99f9aa7b2330fa59 (patch)
treef45950f61a4b27f128518be52157021ca4f4e8f7 /lib/sqlalchemy/testing/suite
parenta99ea884403de1e1f762e9b1eb635d7fc6ef8e6f (diff)
downloadsqlalchemy-36e7aebd8d6faac77570403e99f9aa7b2330fa59.tar.gz
First round of removal of python 2
References: #4600 Change-Id: I61e35bc93fe95610ae75b31c18a3282558cd4ffe
Diffstat (limited to 'lib/sqlalchemy/testing/suite')
-rw-r--r--lib/sqlalchemy/testing/suite/test_dialect.py8
-rw-r--r--lib/sqlalchemy/testing/suite/test_types.py10
-rw-r--r--lib/sqlalchemy/testing/suite/test_unicode_ddl.py31
3 files changed, 16 insertions, 33 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_dialect.py b/lib/sqlalchemy/testing/suite/test_dialect.py
index c2c17d0dd..32dfdedad 100644
--- a/lib/sqlalchemy/testing/suite/test_dialect.py
+++ b/lib/sqlalchemy/testing/suite/test_dialect.py
@@ -19,7 +19,6 @@ from ... import Integer
from ... import literal_column
from ... import select
from ... import String
-from ...util import compat
class ExceptionTest(fixtures.TablesTest):
@@ -77,12 +76,7 @@ class ExceptionTest(fixtures.TablesTest):
assert str(err.orig) in str(err)
- # test that we are actually getting string on Py2k, unicode
- # on Py3k.
- if compat.py2k:
- assert isinstance(err_str, str)
- else:
- assert isinstance(err_str, str)
+ assert isinstance(err_str, str)
class IsolationLevelTest(fixtures.TestBase):
diff --git a/lib/sqlalchemy/testing/suite/test_types.py b/lib/sqlalchemy/testing/suite/test_types.py
index 22b85f398..93d37d4d5 100644
--- a/lib/sqlalchemy/testing/suite/test_types.py
+++ b/lib/sqlalchemy/testing/suite/test_types.py
@@ -873,8 +873,11 @@ class JSONTest(_LiteralRoundTripFixture, fixtures.TablesTest):
("numeric", 1234567.89),
# this one "works" because the float value you see here is
# lost immediately to floating point stuff
- ("numeric", 99998969694839.983485848, requirements.python3),
- ("numeric", 99939.983485848, requirements.python3),
+ (
+ "numeric",
+ 99998969694839.983485848,
+ ),
+ ("numeric", 99939.983485848),
("_decimal", decimal.Decimal("1234567.89")),
(
"_decimal",
@@ -991,8 +994,7 @@ class JSONTest(_LiteralRoundTripFixture, fixtures.TablesTest):
roundtrip = conn.scalar(select(expr))
eq_(roundtrip, compare_value)
- if util.py3k: # skip py2k to avoid comparing unicode to str etc.
- is_(type(roundtrip), type(compare_value))
+ is_(type(roundtrip), type(compare_value))
@_index_fixtures(True)
@testing.emits_warning(r".*does \*not\* support Decimal objects natively")
diff --git a/lib/sqlalchemy/testing/suite/test_unicode_ddl.py b/lib/sqlalchemy/testing/suite/test_unicode_ddl.py
index a4ae3348e..1334eb8db 100644
--- a/lib/sqlalchemy/testing/suite/test_unicode_ddl.py
+++ b/lib/sqlalchemy/testing/suite/test_unicode_ddl.py
@@ -6,7 +6,6 @@ from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import testing
-from sqlalchemy import util
from sqlalchemy.testing import eq_
from sqlalchemy.testing import fixtures
from sqlalchemy.testing.schema import Column
@@ -183,24 +182,12 @@ class UnicodeSchemaTest(fixtures.TablesTest):
t = Table(
ue("\u6e2c\u8a66"), meta, Column(ue("\u6e2c\u8a66_id"), Integer)
)
-
- if util.py2k:
- eq_(
- repr(t),
- (
- "Table('\\u6e2c\\u8a66', MetaData(), "
- "Column('\\u6e2c\\u8a66_id', Integer(), "
- "table=<\u6e2c\u8a66>), "
- "schema=None)"
- ),
- )
- else:
- eq_(
- repr(t),
- (
- "Table('測試', MetaData(), "
- "Column('測試_id', Integer(), "
- "table=<測試>), "
- "schema=None)"
- ),
- )
+ eq_(
+ repr(t),
+ (
+ "Table('測試', MetaData(), "
+ "Column('測試_id', Integer(), "
+ "table=<測試>), "
+ "schema=None)"
+ ),
+ )