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:
Raymond Hettinger 2003-08-30 22:54:55 +00:00
parent c11dbcd4bf
commit f9f4c6945e
5 changed files with 141 additions and 29 deletions

View file

@ -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,