diff --git a/tests/basics/set_pop.py b/tests/basics/set_pop.py
index 5e1196c9f06113eb8609fb4452f2a150b58467b1..e951ca5931f2ab4b074d1f49b3044d902536b101 100644
--- a/tests/basics/set_pop.py
+++ b/tests/basics/set_pop.py
@@ -15,4 +15,4 @@ while s:
     print(s.pop()) # last pop() should trigger the optimisation
 for i in range(N):
     s.add(i) # check that we can add the numbers back to the set
-print(list(s))
+print(sorted(s))