mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
SF patch #736962: Port tests to unittest
(Contributed by Walter Dörwald). * Convert three test modules to unittest format. * Expanded coverage in test_structseq.py. * Raymond added a new test in test_sets.py
This commit is contained in:
parent
c11dbcd4bf
commit
f9f4c6945e
5 changed files with 141 additions and 29 deletions
|
@ -596,6 +596,7 @@ class TestOnlySetsInBinaryOps(unittest.TestCase):
|
|||
self.set.difference(self.other)
|
||||
else:
|
||||
self.assertRaises(TypeError, self.set.difference, self.other)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
class TestOnlySetsNumeric(TestOnlySetsInBinaryOps):
|
||||
|
@ -647,6 +648,14 @@ class TestOnlySetsGenerator(TestOnlySetsInBinaryOps):
|
|||
self.other = gen()
|
||||
self.otherIsIterable = True
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
class TestOnlySetsofSets(TestOnlySetsInBinaryOps):
|
||||
def setUp(self):
|
||||
self.set = Set((1, 2, 3))
|
||||
self.other = [Set('ab'), ImmutableSet('cd')]
|
||||
self.otherIsIterable = True
|
||||
|
||||
#==============================================================================
|
||||
|
||||
class TestCopying(unittest.TestCase):
|
||||
|
@ -801,6 +810,7 @@ def test_main(verbose=None):
|
|||
TestOnlySetsTuple,
|
||||
TestOnlySetsString,
|
||||
TestOnlySetsGenerator,
|
||||
TestOnlySetsofSets,
|
||||
TestCopyingEmpty,
|
||||
TestCopyingSingleton,
|
||||
TestCopyingTriple,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue