From 218a70537aa4d9701e7a91ad85ddaef1752cff6c Mon Sep 17 00:00:00 2001 From: Serkan Yersen Date: Thu, 20 Feb 2014 00:29:40 -0800 Subject: [PATCH] Fix undeterministic test for python3 --- tests/test_collections.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_collections.py b/tests/test_collections.py index a080202..1ca6e93 100644 --- a/tests/test_collections.py +++ b/tests/test_collections.py @@ -238,7 +238,9 @@ def test_partition(self): self.assertEqual(_.partition(list, lambda x, *args: None if x > 1 else True ), [[0,1],[2,3,4,5]], 'handles null return values') # Test an object - self.assertEqual(_.partition({"a": 1, "b": 2, "c": 3}, lambda x, *args: x > 1 ), [[3, 2], [1]], 'handles objects') + result = _.partition({"a": 1, "b": 2, "c": 3}, lambda x, *args: x > 1 ) + # Has to handle difference between python3 and python2 + self.assertTrue((result == [[3, 2], [1]] or result == [[2, 3], [1]]), 'handles objects') # Default iterator self.assertEqual(_.partition([1, False, True, '']), [[1, True], [False, '']], 'Default iterator')