remove use of 2.7 unittest features

This commit is contained in:
Benjamin Peterson 2010-04-07 20:40:30 +00:00
parent 29b8781c65
commit 1b21be2662
1 changed files with 7 additions and 5 deletions

View File

@ -4,8 +4,6 @@ import select
import os import os
import sys import sys
@unittest.skipIf(sys.platform[:3] in ('win', 'mac', 'os2', 'riscos'),
"can't easily test on this system")
class SelectTestCase(unittest.TestCase): class SelectTestCase(unittest.TestCase):
class Nope: class Nope:
@ -24,11 +22,15 @@ class SelectTestCase(unittest.TestCase):
def test_returned_list_identity(self): def test_returned_list_identity(self):
# See issue #8329 # See issue #8329
r, w, x = select.select([], [], [], 1) r, w, x = select.select([], [], [], 1)
self.assertIsNot(r, w) self.assertFalse(r is w)
self.assertIsNot(r, x) self.assertFalse(r is x)
self.assertIsNot(w, x) self.assertFalse(w is x)
def test_select(self): def test_select(self):
if sys.platform[:3] in ('win', 'mac', 'os2'):
if test_support.verbose:
print "can't easily test on this system"
return
cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done' cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done'
p = os.popen(cmd, 'r') p = os.popen(cmd, 'r')
for tout in (0, 1, 2, 4, 8, 16) + (None,)*10: for tout in (0, 1, 2, 4, 8, 16) + (None,)*10: