summaryrefslogtreecommitdiff
path: root/Lib/test/test_sets.py
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-01-08 19:04:16 +0000
committerSenthil Kumaran <orsenthil@gmail.com>2010-01-08 19:04:16 +0000
commitce8e33a095030e7af94f58f9da196b240bdf0476 (patch)
treeb0ba50cbb6e85c6be6f6e6a870e4232be50a0f9c /Lib/test/test_sets.py
parent3ddc435af6873c6304058d7bcbcb19ee4fba7781 (diff)
downloadcpython-git-ce8e33a095030e7af94f58f9da196b240bdf0476.tar.gz
Reverting the Revision: 77368. I committed Flox's big patch for tests by
mistake. ( It may come in for sure tough)
Diffstat (limited to 'Lib/test/test_sets.py')
-rw-r--r--Lib/test/test_sets.py36
1 files changed, 17 insertions, 19 deletions
diff --git a/Lib/test/test_sets.py b/Lib/test/test_sets.py
index 754ceb16c8..9c598361a6 100644
--- a/Lib/test/test_sets.py
+++ b/Lib/test/test_sets.py
@@ -510,17 +510,15 @@ class TestOnlySetsInBinaryOps(unittest.TestCase):
self.assertEqual(self.set != self.other, True)
def test_ge_gt_le_lt(self):
- # Silence Py3k warning
- with test_support.check_warnings():
- self.assertRaises(TypeError, lambda: self.set < self.other)
- self.assertRaises(TypeError, lambda: self.set <= self.other)
- self.assertRaises(TypeError, lambda: self.set > self.other)
- self.assertRaises(TypeError, lambda: self.set >= self.other)
-
- self.assertRaises(TypeError, lambda: self.other < self.set)
- self.assertRaises(TypeError, lambda: self.other <= self.set)
- self.assertRaises(TypeError, lambda: self.other > self.set)
- self.assertRaises(TypeError, lambda: self.other >= self.set)
+ self.assertRaises(TypeError, lambda: self.set < self.other)
+ self.assertRaises(TypeError, lambda: self.set <= self.other)
+ self.assertRaises(TypeError, lambda: self.set > self.other)
+ self.assertRaises(TypeError, lambda: self.set >= self.other)
+
+ self.assertRaises(TypeError, lambda: self.other < self.set)
+ self.assertRaises(TypeError, lambda: self.other <= self.set)
+ self.assertRaises(TypeError, lambda: self.other > self.set)
+ self.assertRaises(TypeError, lambda: self.other >= self.set)
def test_union_update_operator(self):
try:
@@ -681,20 +679,20 @@ class TestCopying(unittest.TestCase):
def test_copy(self):
dup = self.set.copy()
- dup_list = list(dup)
- set_list = list(self.set)
+ dup_list = list(dup); dup_list.sort()
+ set_list = list(self.set); set_list.sort()
self.assertEqual(len(dup_list), len(set_list))
- for elt in dup_list:
- self.assertTrue(elt in set_list)
+ for i in range(len(dup_list)):
+ self.assertTrue(dup_list[i] is set_list[i])
def test_deep_copy(self):
dup = copy.deepcopy(self.set)
##print type(dup), repr(dup)
- dup_list = list(dup)
- set_list = list(self.set)
+ dup_list = list(dup); dup_list.sort()
+ set_list = list(self.set); set_list.sort()
self.assertEqual(len(dup_list), len(set_list))
- for elt in dup_list:
- self.assertTrue(elt in set_list)
+ for i in range(len(dup_list)):
+ self.assertEqual(dup_list[i], set_list[i])
#------------------------------------------------------------------------------