summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-03-17 06:04:34 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-03-17 06:04:34 (GMT)
commit9e2b9665ae9f94a07da54156c48e2cd411a23746 (patch)
treed3f394989607f8aa9c14563291e319fe24ef2a17 /Lib/test
parentcd65e3fc7d3280defdb14d75ffe71e665ed85989 (diff)
downloadcpython-9e2b9665ae9f94a07da54156c48e2cd411a23746.zip
cpython-9e2b9665ae9f94a07da54156c48e2cd411a23746.tar.gz
cpython-9e2b9665ae9f94a07da54156c48e2cd411a23746.tar.bz2
Whoops, input *and* raw_input are slated for removal, and now both are gone.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_builtin.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index c97a7f1..4f10d92 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -1106,7 +1106,6 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, oct, ())
def write_testfile(self):
- # NB the first 4 lines are also used to test input, below
fp = open(TESTFN, 'w')
try:
fp.write('1+1\n')
@@ -1265,36 +1264,6 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(OverflowError, range, -sys.maxint, sys.maxint)
self.assertRaises(OverflowError, range, 0, 2*sys.maxint)
- def test_input(self):
- self.write_testfile()
- fp = open(TESTFN, 'r')
- savestdin = sys.stdin
- savestdout = sys.stdout # Eats the echo
- try:
- sys.stdin = fp
- sys.stdout = BitBucket()
- self.assertEqual(input(), '1+1')
- self.assertEqual(input('testing\n'), '1+1')
- self.assertEqual(input(), 'The quick brown fox jumps over the lazy dog.')
- self.assertEqual(input('testing\n'), 'Dear John')
- sys.stdin = cStringIO.StringIO("NULL\0")
- self.assertRaises(TypeError, input, 42, 42)
- whitespace = " 'whitespace'"
- sys.stdin = cStringIO.StringIO(whitespace)
- self.assertEqual(input(), whitespace)
- sys.stdin = cStringIO.StringIO()
- self.assertRaises(EOFError, input)
-
- del sys.stdout
- self.assertRaises(RuntimeError, input, 'prompt')
- del sys.stdin
- self.assertRaises(RuntimeError, input, 'prompt')
- finally:
- sys.stdin = savestdin
- sys.stdout = savestdout
- fp.close()
- unlink(TESTFN)
-
def test_reduce(self):
self.assertEqual(reduce(lambda x, y: x+y, ['a', 'b', 'c'], ''), 'abc')
self.assertEqual(