Skip to content

Commit 1e59dfb

Browse files
committed
refactor(test, paramstyle): adjust to order result set
1 parent 18db5df commit 1e59dfb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/integration/test_paramstyle.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_pyformat(cursor, parameters):
2727
[
2828
(
2929
({"c1": "abc", "c2": "defg", "c3": "hijkl"}, {"c1": "a", "c2": "b", "c3": "c"}),
30-
[["abc", "defg", "hijkl"], ["a", "b", "c"]],
30+
[["a", "b", "c"], ["abc", "defg", "hijkl"]],
3131
),
3232
],
3333
)
@@ -36,7 +36,7 @@ def test_pyformat_multiple_insert(cursor, parameters):
3636
data, exp_result = parameters
3737
cursor.execute("create temporary table test_pyformat(c1 varchar, c2 varchar, c3 varchar)")
3838
cursor.executemany("insert into test_pyformat(c1, c2, c3) values(%(c1)s, %(c2)s, %(c3)s)", data)
39-
cursor.execute("select * from test_pyformat")
39+
cursor.execute("select * from test_pyformat order by c1")
4040
res: typing.Tuple[typing.List[str, str, str], ...] = cursor.fetchall()
4141
assert len(res) == len(exp_result)
4242
for idx, row in enumerate(res):
@@ -111,15 +111,15 @@ def test_format(cursor, parameters):
111111
@pytest.mark.parametrize(
112112
"parameters",
113113
[
114-
([["abc", "defg", "hijkl"], ["a", "b", "c"]], [["abc", "defg", "hijkl"], ["a", "b", "c"]]),
114+
([["abc", "defg", "hijkl"], ["a", "b", "c"]], [["a", "b", "c"], ["abc", "defg", "hijkl"]]),
115115
],
116116
)
117117
def test_format_multiple(cursor, parameters):
118118
cursor.paramstyle = "format"
119119
data, exp_result = parameters
120120
cursor.execute("create temporary table test_format(c1 varchar, c2 varchar, c3 varchar)")
121121
cursor.executemany("insert into test_format(c1, c2, c3) values(%s, %s, %s)", data)
122-
cursor.execute("select * from test_format")
122+
cursor.execute("select * from test_format order by c1")
123123
res: typing.Tuple[typing.List[str, str, str], ...] = cursor.fetchall()
124124
assert len(res) == len(exp_result)
125125
for idx, row in enumerate(res):

0 commit comments

Comments
 (0)