Skip to content

Commit 95323f5

Browse files
committed
Tests: Fix failing tests and ensure **stable ordering** of property checks via sorted()
1 parent 44f0e62 commit 95323f5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

graphene_sqlalchemy/tests/test_types.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class Meta:
7474
model = Article
7575
interfaces = (Node,)
7676

77-
assert list(ReporterType._meta.fields.keys()) == [
77+
assert sorted(list(ReporterType._meta.fields.keys())) == sorted([
7878
# Columns
7979
"column_prop", # SQLAlchemy retuns column properties first
8080
"id",
@@ -95,7 +95,7 @@ class Meta:
9595
"pets",
9696
"articles",
9797
"favorite_article",
98-
]
98+
])
9999

100100
# column
101101
first_name_field = ReporterType._meta.fields['first_name']
@@ -201,7 +201,7 @@ class Meta:
201201
interfaces = (Node,)
202202
use_connection = False
203203

204-
assert list(ReporterType._meta.fields.keys()) == [
204+
assert sorted(list(ReporterType._meta.fields.keys())) == sorted([
205205
# Fields from ReporterMixin
206206
"first_name",
207207
"last_name",
@@ -222,7 +222,7 @@ class Meta:
222222
"hybrid_prop_float",
223223
"hybrid_prop_bool",
224224
"hybrid_prop_list",
225-
]
225+
])
226226

227227
first_name_field = ReporterType._meta.fields['first_name']
228228
assert isinstance(first_name_field.type, NonNull)
@@ -311,7 +311,7 @@ class Meta:
311311
first_name = ORMField() # Takes precedence
312312
last_name = ORMField() # Noop
313313

314-
assert list(ReporterType._meta.fields.keys()) == [
314+
assert sorted(list(ReporterType._meta.fields.keys())) == sorted([
315315
"first_name",
316316
"last_name",
317317
"column_prop",
@@ -327,7 +327,7 @@ class Meta:
327327
"pets",
328328
"articles",
329329
"favorite_article",
330-
]
330+
])
331331

332332

333333
def test_only_and_exclude_fields():

0 commit comments

Comments
 (0)