Skip to content

Commit 9e8d4e7

Browse files
committed
Modified one compliance StringTest thats been flaky
1 parent 59f0a4e commit 9e8d4e7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
DifficultParametersTest as _DifficultParametersTest,
6969
FetchLimitOffsetTest as _FetchLimitOffsetTest,
7070
PostCompileParamsTest,
71+
StringTest as _StringTest,
7172
UuidTest as _UuidTest,
7273
)
7374

@@ -442,6 +443,30 @@ def test_uuid_returning(self, connection):
442443

443444
eq_(row, (data, str_data, data, str_data))
444445

446+
class StringTest(_StringTest):
447+
def test_dont_truncate_rightside(
448+
self, metadata, connection, expr=None, expected=None
449+
):
450+
t = Table(
451+
"t",
452+
metadata,
453+
Column("x", String(2)),
454+
Column("id", Integer, primary_key=True),
455+
)
456+
t.create(connection)
457+
connection.connection.commit()
458+
connection.execute(
459+
t.insert(),
460+
[{"x": "AB", "id": 1}, {"x": "BC", "id": 2}, {"x": "AC", "id": 3}],
461+
)
462+
combinations = [("%B%", ["AB", "BC"]), ("A%C", ["AC"]), ("A%C%Z", [])]
463+
464+
for args in combinations:
465+
eq_(
466+
connection.scalars(select(t.c.x).where(t.c.x.like(args[0]))).all(),
467+
args[1],
468+
)
469+
445470
# from else statement ....
446471
del DistinctOnTest # expects unquoted table names.
447472
del HasIndexTest # BQ doesn't do the indexes that SQLA is loooking for.

0 commit comments

Comments
 (0)