Skip to content

Commit

Permalink
Fix undeterministic test for python3
Browse files Browse the repository at this point in the history
  • Loading branch information
serkanyersen committed Feb 20, 2014
1 parent 1e50506 commit 218a705
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_collections.py
Expand Up @@ -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')
Expand Down

0 comments on commit 218a705

Please sign in to comment.