Skip to content

Commit 218a705

Browse files
committed
Fix undeterministic test for python3
1 parent 1e50506 commit 218a705

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_collections.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,9 @@ def test_partition(self):
238238
self.assertEqual(_.partition(list, lambda x, *args: None if x > 1 else True ), [[0,1],[2,3,4,5]], 'handles null return values')
239239

240240
# Test an object
241-
self.assertEqual(_.partition({"a": 1, "b": 2, "c": 3}, lambda x, *args: x > 1 ), [[3, 2], [1]], 'handles objects')
241+
result = _.partition({"a": 1, "b": 2, "c": 3}, lambda x, *args: x > 1 )
242+
# Has to handle difference between python3 and python2
243+
self.assertTrue((result == [[3, 2], [1]] or result == [[2, 3], [1]]), 'handles objects')
242244

243245
# Default iterator
244246
self.assertEqual(_.partition([1, False, True, '']), [[1, True], [False, '']], 'Default iterator')

0 commit comments

Comments
 (0)