mirror of https://github.com/python/cpython
Simplified the setup for is-subset testing.
This commit is contained in:
parent
4924db176b
commit
0bbb30830c
|
@ -371,47 +371,42 @@ class TestSubsets(unittest.TestCase):
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
class TestSubsetEqualEmpty(TestSubsets):
|
class TestSubsetEqualEmpty(TestSubsets):
|
||||||
def setUp(self):
|
left = Set()
|
||||||
self.left = Set()
|
right = Set()
|
||||||
self.right = Set()
|
name = "both empty"
|
||||||
self.name = "both empty"
|
cases = "<>"
|
||||||
self.cases = "<>"
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
class TestSubsetEqualNonEmpty(TestSubsets):
|
class TestSubsetEqualNonEmpty(TestSubsets):
|
||||||
def setUp(self):
|
left = Set([1, 2])
|
||||||
self.left = Set([1, 2])
|
right = Set([1, 2])
|
||||||
self.right = Set([1, 2])
|
name = "equal pair"
|
||||||
self.name = "equal pair"
|
cases = "<>"
|
||||||
self.cases = "<>"
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
class TestSubsetEmptyNonEmpty(TestSubsets):
|
class TestSubsetEmptyNonEmpty(TestSubsets):
|
||||||
def setUp(self):
|
left = Set()
|
||||||
self.left = Set()
|
right = Set([1, 2])
|
||||||
self.right = Set([1, 2])
|
name = "one empty, one non-empty"
|
||||||
self.name = "one empty, one non-empty"
|
cases = "<"
|
||||||
self.cases = "<"
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
class TestSubsetPartial(TestSubsets):
|
class TestSubsetPartial(TestSubsets):
|
||||||
def setUp(self):
|
left = Set([1])
|
||||||
self.left = Set([1])
|
right = Set([1, 2])
|
||||||
self.right = Set([1, 2])
|
name = "one a non-empty subset of other"
|
||||||
self.name = "one a non-empty subset of other"
|
cases = "<"
|
||||||
self.cases = "<"
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
class TestSubsetNonOverlap(TestSubsets):
|
class TestSubsetNonOverlap(TestSubsets):
|
||||||
def setUp(self):
|
left = Set([1])
|
||||||
self.left = Set([1])
|
right = Set([2])
|
||||||
self.right = Set([2])
|
name = "neither empty, neither contains"
|
||||||
self.name = "neither empty, neither contains"
|
cases = ""
|
||||||
self.cases = ""
|
|
||||||
|
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue