Commit f3a5c35a authored by Walter Dörwald's avatar Walter Dörwald

Remove have_unicode checks and merge those tests into the

normal code (or drop them if they only repeat previous
tests).
parent c314596c
...@@ -752,35 +752,34 @@ class CharacterTest(StringTest): ...@@ -752,35 +752,34 @@ class CharacterTest(StringTest):
tests.append(CharacterTest) tests.append(CharacterTest)
if test_support.have_unicode: class UnicodeTest(StringTest):
class UnicodeTest(StringTest): typecode = 'u'
typecode = 'u' example = '\x01\u263a\x00\ufeff'
example = '\x01\u263a\x00\ufeff' smallerexample = '\x01\u263a\x00\ufefe'
smallerexample = '\x01\u263a\x00\ufefe' biggerexample = '\x01\u263a\x01\ufeff'
biggerexample = '\x01\u263a\x01\ufeff' outside = str('\x33')
outside = str('\x33') minitemsize = 2
minitemsize = 2
def test_unicode(self):
def test_unicode(self): self.assertRaises(TypeError, array.array, 'b', 'foo')
self.assertRaises(TypeError, array.array, 'b', 'foo')
a = array.array('u', '\xa0\xc2\u1234')
a = array.array('u', '\xa0\xc2\u1234') a.fromunicode(' ')
a.fromunicode(' ') a.fromunicode('')
a.fromunicode('') a.fromunicode('')
a.fromunicode('') a.fromunicode('\x11abc\xff\u1234')
a.fromunicode('\x11abc\xff\u1234') s = a.tounicode()
s = a.tounicode() self.assertEqual(s, '\xa0\xc2\u1234 \x11abc\xff\u1234')
self.assertEqual(s, '\xa0\xc2\u1234 \x11abc\xff\u1234')
s = '\x00="\'a\\b\x80\xff\u0000\u0001\u1234'
s = '\x00="\'a\\b\x80\xff\u0000\u0001\u1234' a = array.array('u', s)
a = array.array('u', s) self.assertEqual(
self.assertEqual( repr(a),
repr(a), "array('u', '\\x00=\"\\'a\\\\b\\x80\\xff\\x00\\x01\\u1234')")
"array('u', '\\x00=\"\\'a\\\\b\\x80\\xff\\x00\\x01\\u1234')")
self.assertRaises(TypeError, a.fromunicode)
self.assertRaises(TypeError, a.fromunicode)
tests.append(UnicodeTest)
tests.append(UnicodeTest)
class NumberTest(BaseTest): class NumberTest(BaseTest):
......
# Python test set -- built-in functions # Python test set -- built-in functions
import test.test_support, unittest import test.test_support, unittest
from test.test_support import fcmp, have_unicode, TESTFN, unlink, \ from test.test_support import fcmp, TESTFN, unlink, run_unittest, \
run_unittest, run_with_locale run_with_locale
from operator import neg from operator import neg
import sys, warnings, cStringIO, random, UserDict import sys, warnings, cStringIO, random, UserDict
...@@ -70,26 +70,8 @@ L = [ ...@@ -70,26 +70,8 @@ L = [
(' 1\02 ', ValueError), (' 1\02 ', ValueError),
('', ValueError), ('', ValueError),
(' ', ValueError), (' ', ValueError),
(' \t\t ', ValueError) (' \t\t ', ValueError),
]
if have_unicode:
L += [
(str('0'), 0),
(str('1'), 1),
(str('9'), 9),
(str('10'), 10),
(str('99'), 99),
(str('100'), 100),
(str('314'), 314),
(str(' 314'), 314),
(str(b'\u0663\u0661\u0664 ','raw-unicode-escape'), 314), (str(b'\u0663\u0661\u0664 ','raw-unicode-escape'), 314),
(str(' \t\t 314 \t\t '), 314),
(str(' 1x'), ValueError),
(str(' 1 '), 1),
(str(' 1\02 '), ValueError),
(str(''), ValueError),
(str(' '), ValueError),
(str(' \t\t '), ValueError),
(chr(0x200), ValueError), (chr(0x200), ValueError),
] ]
...@@ -186,6 +168,11 @@ class BuiltinTest(unittest.TestCase): ...@@ -186,6 +168,11 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(chr(97), 'a') self.assertEqual(chr(97), 'a')
self.assertEqual(chr(0xff), '\xff') self.assertEqual(chr(0xff), '\xff')
self.assertRaises(ValueError, chr, 1<<24) self.assertRaises(ValueError, chr, 1<<24)
self.assertEqual(
chr(sys.maxunicode),
str(('\\U%08x' % (sys.maxunicode)).encode("ascii"), 'unicode-escape')
)
self.assertRaises(ValueError, chr, sys.maxunicode+1)
self.assertRaises(TypeError, chr) self.assertRaises(TypeError, chr)
def XXX_test_cmp(self): def XXX_test_cmp(self):
...@@ -219,11 +206,9 @@ class BuiltinTest(unittest.TestCase): ...@@ -219,11 +206,9 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, compile, chr(0), 'f', 'exec') self.assertRaises(TypeError, compile, chr(0), 'f', 'exec')
self.assertRaises(TypeError, compile, 'pass', '?', 'exec', self.assertRaises(TypeError, compile, 'pass', '?', 'exec',
mode='eval', source='0', filename='tmp') mode='eval', source='0', filename='tmp')
if have_unicode: compile('print("\xe5")\n', '', 'exec')
compile('print("\xe5")\n', '', 'exec') self.assertRaises(TypeError, compile, chr(0), 'f', 'exec')
self.assertRaises(TypeError, compile, chr(0), 'f', 'exec') self.assertRaises(ValueError, compile, str('a = 1'), 'f', 'bad')
self.assertRaises(ValueError, compile, str('a = 1'), 'f', 'bad')
def test_delattr(self): def test_delattr(self):
import sys import sys
...@@ -328,19 +313,11 @@ class BuiltinTest(unittest.TestCase): ...@@ -328,19 +313,11 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(eval('a', globals, locals), 1) self.assertEqual(eval('a', globals, locals), 1)
self.assertEqual(eval('b', globals, locals), 200) self.assertEqual(eval('b', globals, locals), 200)
self.assertEqual(eval('c', globals, locals), 300) self.assertEqual(eval('c', globals, locals), 300)
if have_unicode:
self.assertEqual(eval(str('1+1')), 2)
self.assertEqual(eval(str(' 1+1\n')), 2)
globals = {'a': 1, 'b': 2} globals = {'a': 1, 'b': 2}
locals = {'b': 200, 'c': 300} locals = {'b': 200, 'c': 300}
if have_unicode: ## bom = b'\xef\xbb\xbf'
self.assertEqual(eval(str('a'), globals), 1) ## self.assertEqual(eval(bom + b'a', globals, locals), 1)
self.assertEqual(eval(str('a'), globals, locals), 1) self.assertEqual(eval('"\xe5"', globals), "\xe5")
self.assertEqual(eval(str('b'), globals, locals), 200)
self.assertEqual(eval(str('c'), globals, locals), 300)
## bom = b'\xef\xbb\xbf'
## self.assertEqual(eval(bom + b'a', globals, locals), 1)
self.assertEqual(eval('"\xe5"', globals), "\xe5")
self.assertRaises(TypeError, eval) self.assertRaises(TypeError, eval)
self.assertRaises(TypeError, eval, ()) self.assertRaises(TypeError, eval, ())
...@@ -512,7 +489,7 @@ class BuiltinTest(unittest.TestCase): ...@@ -512,7 +489,7 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(filter(lambda x: x>=3, (1, 2, 3, 4)), (3, 4)) self.assertEqual(filter(lambda x: x>=3, (1, 2, 3, 4)), (3, 4))
self.assertRaises(TypeError, filter, 42, (1, 2)) self.assertRaises(TypeError, filter, 42, (1, 2))
# test bltinmodule.c::filterstring() # test bltinmodule.c::filterunicode()
self.assertEqual(filter(None, "12"), "12") self.assertEqual(filter(None, "12"), "12")
self.assertEqual(filter(lambda x: x>="3", "1234"), "34") self.assertEqual(filter(lambda x: x>="3", "1234"), "34")
self.assertRaises(TypeError, filter, 42, "12") self.assertRaises(TypeError, filter, 42, "12")
...@@ -536,34 +513,8 @@ class BuiltinTest(unittest.TestCase): ...@@ -536,34 +513,8 @@ class BuiltinTest(unittest.TestCase):
return chr(ord(str.__getitem__(self, index))+1) return chr(ord(str.__getitem__(self, index))+1)
self.assertEqual(filter(lambda x: x>="3", shiftstr("1234")), "345") self.assertEqual(filter(lambda x: x>="3", shiftstr("1234")), "345")
if have_unicode:
# test bltinmodule.c::filterunicode()
self.assertEqual(filter(None, str("12")), str("12"))
self.assertEqual(filter(lambda x: x>="3", str("1234")), str("34"))
self.assertRaises(TypeError, filter, 42, str("12"))
self.assertRaises(ValueError, filter, lambda x: x >="3", badstr(str("1234")))
class badunicode(str):
def __getitem__(self, index):
return 42
self.assertRaises(TypeError, filter, lambda x: x >=42, badunicode("1234"))
class weirdunicode(str):
def __getitem__(self, index):
return weirdunicode(2*str.__getitem__(self, index))
self.assertEqual(
filter(lambda x: x>=str("33"), weirdunicode("1234")), str("3344"))
class shiftunicode(str):
def __getitem__(self, index):
return chr(ord(str.__getitem__(self, index))+1)
self.assertEqual(
filter(lambda x: x>=str("3"), shiftunicode("1234")),
str("345")
)
def test_filter_subclasses(self): def test_filter_subclasses(self):
# test that filter() never returns tuple, str or unicode subclasses # test that filter() never returns tuple or str subclasses
# and that the result always goes through __getitem__ # and that the result always goes through __getitem__
funcs = (None, bool, lambda x: True) funcs = (None, bool, lambda x: True)
class tuple2(tuple): class tuple2(tuple):
...@@ -576,14 +527,6 @@ class BuiltinTest(unittest.TestCase): ...@@ -576,14 +527,6 @@ class BuiltinTest(unittest.TestCase):
tuple2: {(): (), (1, 2, 3): (2, 4, 6)}, tuple2: {(): (), (1, 2, 3): (2, 4, 6)},
str2: {"": "", "123": "112233"} str2: {"": "", "123": "112233"}
} }
if have_unicode:
class unicode2(str):
def __getitem__(self, index):
return 2*str.__getitem__(self, index)
inputs[unicode2] = {
str(): str(),
str("123"): str("112233")
}
for (cls, inps) in inputs.items(): for (cls, inps) in inputs.items():
for (inp, exp) in inps.items(): for (inp, exp) in inps.items():
...@@ -605,10 +548,8 @@ class BuiltinTest(unittest.TestCase): ...@@ -605,10 +548,8 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(float(" 3.14 "), 3.14) self.assertEqual(float(" 3.14 "), 3.14)
self.assertRaises(ValueError, float, " 0x3.1 ") self.assertRaises(ValueError, float, " 0x3.1 ")
self.assertRaises(ValueError, float, " -0x3.p-1 ") self.assertRaises(ValueError, float, " -0x3.p-1 ")
if have_unicode: self.assertEqual(float(str(b" \u0663.\u0661\u0664 ",'raw-unicode-escape')), 3.14)
self.assertEqual(float(str(" 3.14 ")), 3.14) self.assertEqual(float("1"*10000), 1e10000) # Inf on both sides
self.assertEqual(float(str(b" \u0663.\u0661\u0664 ",'raw-unicode-escape')), 3.14)
self.assertEqual(float("1"*10000), 1e10000) # Inf on both sides
@run_with_locale('LC_NUMERIC', 'fr_FR', 'de_DE') @run_with_locale('LC_NUMERIC', 'fr_FR', 'de_DE')
def test_float_with_comma(self): def test_float_with_comma(self):
...@@ -687,8 +628,7 @@ class BuiltinTest(unittest.TestCase): ...@@ -687,8 +628,7 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(hash(1), hash(1)) self.assertEqual(hash(1), hash(1))
self.assertEqual(hash(1), hash(1.0)) self.assertEqual(hash(1), hash(1.0))
hash('spam') hash('spam')
if have_unicode: self.assertEqual(hash('spam'), hash(str8('spam')))
self.assertEqual(hash('spam'), hash(str('spam')))
hash((0,1,2,3)) hash((0,1,2,3))
def f(): pass def f(): pass
self.assertRaises(TypeError, hash, []) self.assertRaises(TypeError, hash, [])
...@@ -738,8 +678,6 @@ class BuiltinTest(unittest.TestCase): ...@@ -738,8 +678,6 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(int(-3.5), -3) self.assertEqual(int(-3.5), -3)
# Different base: # Different base:
self.assertEqual(int("10",16), 16) self.assertEqual(int("10",16), 16)
if have_unicode:
self.assertEqual(int(str("10"),16), 16)
# Test conversion from strings and various anomalies # Test conversion from strings and various anomalies
for s, v in L: for s, v in L:
for sign in "", "+", "-": for sign in "", "+", "-":
...@@ -784,9 +722,8 @@ class BuiltinTest(unittest.TestCase): ...@@ -784,9 +722,8 @@ class BuiltinTest(unittest.TestCase):
x = int('1' * 600) x = int('1' * 600)
self.assert_(isinstance(x, int)) self.assert_(isinstance(x, int))
if have_unicode: x = int(chr(0x661) * 600)
x = int(chr(0x661) * 600) self.assert_(isinstance(x, int))
self.assert_(isinstance(x, int))
self.assertRaises(TypeError, int, 1, 12) self.assertRaises(TypeError, int, 1, 12)
...@@ -908,8 +845,6 @@ class BuiltinTest(unittest.TestCase): ...@@ -908,8 +845,6 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, iter) self.assertRaises(TypeError, iter)
self.assertRaises(TypeError, iter, 42, 42) self.assertRaises(TypeError, iter, 42, 42)
lists = [("1", "2"), ["1", "2"], "12"] lists = [("1", "2"), ["1", "2"], "12"]
if have_unicode:
lists.append(str("12"))
for l in lists: for l in lists:
i = iter(l) i = iter(l)
self.assertEqual(next(i), '1') self.assertEqual(next(i), '1')
...@@ -1007,24 +942,14 @@ class BuiltinTest(unittest.TestCase): ...@@ -1007,24 +942,14 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(int(3.5), 3) self.assertEqual(int(3.5), 3)
self.assertEqual(int(-3.5), -3) self.assertEqual(int(-3.5), -3)
self.assertEqual(int("-3"), -3) self.assertEqual(int("-3"), -3)
if have_unicode:
self.assertEqual(int(str("-3")), -3)
# Different base: # Different base:
self.assertEqual(int("10",16), 16) self.assertEqual(int("10",16), 16)
if have_unicode:
self.assertEqual(int(str("10"),16), 16)
# Check conversions from string (same test set as for int(), and then some) # Check conversions from string (same test set as for int(), and then some)
LL = [ LL = [
('1' + '0'*20, 10**20), ('1' + '0'*20, 10**20),
('1' + '0'*100, 10**100) ('1' + '0'*100, 10**100)
] ]
L2 = L[:] for s, v in LL:
if have_unicode:
L2 += [
(str('1') + str('0')*20, 10**20),
(str('1') + str('0')*100, 10**100),
]
for s, v in L2 + LL:
for sign in "", "+", "-": for sign in "", "+", "-":
for prefix in "", " ", "\t", " \t\t ": for prefix in "", " ", "\t", " \t\t ":
ss = prefix + sign + s ss = prefix + sign + s
...@@ -1391,11 +1316,8 @@ class BuiltinTest(unittest.TestCase): ...@@ -1391,11 +1316,8 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(ord(b'\x80'), 128) self.assertEqual(ord(b'\x80'), 128)
self.assertEqual(ord(b'\xff'), 255) self.assertEqual(ord(b'\xff'), 255)
if have_unicode: self.assertEqual(ord(chr(sys.maxunicode)), sys.maxunicode)
self.assertEqual(ord(chr(sys.maxunicode)), sys.maxunicode)
self.assertRaises(TypeError, ord, 42) self.assertRaises(TypeError, ord, 42)
if have_unicode:
self.assertRaises(TypeError, ord, str("12"))
def test_pow(self): def test_pow(self):
self.assertEqual(pow(0,0), 1) self.assertEqual(pow(0,0), 1)
...@@ -1675,18 +1597,6 @@ class BuiltinTest(unittest.TestCase): ...@@ -1675,18 +1597,6 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(type(''), type('123')) self.assertEqual(type(''), type('123'))
self.assertNotEqual(type(''), type(())) self.assertNotEqual(type(''), type(()))
def test_unichr(self):
if have_unicode:
self.assertEqual(chr(32), str(' '))
self.assertEqual(chr(65), str('A'))
self.assertEqual(chr(97), str('a'))
self.assertEqual(
chr(sys.maxunicode),
str(('\\U%08x' % (sys.maxunicode)).encode("ascii"), 'unicode-escape')
)
self.assertRaises(ValueError, chr, sys.maxunicode+1)
self.assertRaises(TypeError, chr)
# We don't want self in vars(), so these are static methods # We don't want self in vars(), so these are static methods
@staticmethod @staticmethod
...@@ -1774,16 +1684,12 @@ class TestSorted(unittest.TestCase): ...@@ -1774,16 +1684,12 @@ class TestSorted(unittest.TestCase):
def test_inputtypes(self): def test_inputtypes(self):
s = 'abracadabra' s = 'abracadabra'
types = [list, tuple] types = [list, tuple, str]
if have_unicode:
types.insert(0, str)
for T in types: for T in types:
self.assertEqual(sorted(s), sorted(T(s))) self.assertEqual(sorted(s), sorted(T(s)))
s = ''.join(dict.fromkeys(s).keys()) # unique letters only s = ''.join(set(s)) # unique letters only
types = [set, frozenset, list, tuple, dict.fromkeys] types = [str, set, frozenset, list, tuple, dict.fromkeys]
if have_unicode:
types.insert(0, str)
for T in types: for T in types:
self.assertEqual(sorted(s), sorted(T(s))) self.assertEqual(sorted(s), sorted(T(s)))
......
...@@ -226,8 +226,6 @@ class ComplexTest(unittest.TestCase): ...@@ -226,8 +226,6 @@ class ComplexTest(unittest.TestCase):
self.assertRaises(TypeError, complex, 1, "1") self.assertRaises(TypeError, complex, 1, "1")
self.assertEqual(complex(" 3.14+J "), 3.14+1j) self.assertEqual(complex(" 3.14+J "), 3.14+1j)
if test_support.have_unicode:
self.assertEqual(complex(str(" 3.14+J ")), 3.14+1j)
# SF bug 543840: complex(string) accepts strings with \0 # SF bug 543840: complex(string) accepts strings with \0
# Fixed in 2.3. # Fixed in 2.3.
...@@ -250,9 +248,8 @@ class ComplexTest(unittest.TestCase): ...@@ -250,9 +248,8 @@ class ComplexTest(unittest.TestCase):
self.assertRaises(ValueError, complex, "1+2j)") self.assertRaises(ValueError, complex, "1+2j)")
self.assertRaises(ValueError, complex, "1+(2j)") self.assertRaises(ValueError, complex, "1+(2j)")
self.assertRaises(ValueError, complex, "(1+2j)123") self.assertRaises(ValueError, complex, "(1+2j)123")
if test_support.have_unicode: self.assertRaises(ValueError, complex, "1"*500)
self.assertRaises(ValueError, complex, str("1"*500)) self.assertRaises(ValueError, complex, "x")
self.assertRaises(ValueError, complex, str("x"))
class EvilExc(Exception): class EvilExc(Exception):
pass pass
......
from test.test_support import TestFailed, have_unicode from test.test_support import TestFailed
class base_set: class base_set:
...@@ -55,36 +55,6 @@ except TypeError: ...@@ -55,36 +55,6 @@ except TypeError:
pass pass
if have_unicode:
# Test char in Unicode
check('c' in str('abc'), "'c' not in u'abc'")
check('d' not in str('abc'), "'d' in u'abc'")
check('' in str(''), "'' not in u''")
check(str('') in '', "u'' not in ''")
check(str('') in str(''), "u'' not in u''")
check('' in str('abc'), "'' not in u'abc'")
check(str('') in 'abc', "u'' not in 'abc'")
check(str('') in str('abc'), "u'' not in u'abc'")
try:
None in str('abc')
check(0, "None in u'abc' did not raise error")
except TypeError:
pass
# Test Unicode char in Unicode
check(str('c') in str('abc'), "u'c' not in u'abc'")
check(str('d') not in str('abc'), "u'd' in u'abc'")
# Test Unicode char in string
check(str('c') in 'abc', "u'c' not in 'abc'")
check(str('d') not in 'abc', "u'd' in 'abc'")
# A collection of tests on builtin sequence types # A collection of tests on builtin sequence types
a = list(range(10)) a = list(range(10))
for i in a: for i in a:
......
...@@ -242,8 +242,7 @@ class TestIsInstanceIsSubclass(unittest.TestCase): ...@@ -242,8 +242,7 @@ class TestIsInstanceIsSubclass(unittest.TestCase):
self.assertEqual(True, issubclass(NewSuper, (NewChild, (NewSuper,)))) self.assertEqual(True, issubclass(NewSuper, (NewChild, (NewSuper,))))
self.assertEqual(True, issubclass(int, (int, (float, int)))) self.assertEqual(True, issubclass(int, (int, (float, int))))
if test_support.have_unicode: self.assertEqual(True, issubclass(str, (str, (Child, NewChild, basestring))))
self.assertEqual(True, issubclass(str, (str, (Child, NewChild, basestring))))
def test_subclass_recursion_limit(self): def test_subclass_recursion_limit(self):
# make sure that issubclass raises RuntimeError before the C stack is # make sure that issubclass raises RuntimeError before the C stack is
......
# Test iterators. # Test iterators.
import unittest import unittest
from test.test_support import run_unittest, TESTFN, unlink, have_unicode from test.test_support import run_unittest, TESTFN, unlink
# Test result of triple loop (too big to inline) # Test result of triple loop (too big to inline)
TRIPLETS = [(0, 0, 0), (0, 0, 1), (0, 0, 2), TRIPLETS = [(0, 0, 0), (0, 0, 1), (0, 0, 2),
...@@ -213,13 +213,6 @@ class TestCase(unittest.TestCase): ...@@ -213,13 +213,6 @@ class TestCase(unittest.TestCase):
def test_iter_string(self): def test_iter_string(self):
self.check_for_loop(iter("abcde"), ["a", "b", "c", "d", "e"]) self.check_for_loop(iter("abcde"), ["a", "b", "c", "d", "e"])
# Test a Unicode string
if have_unicode:
def test_iter_unicode(self):
self.check_for_loop(iter(str("abcde")),
[str("a"), str("b"), str("c"),
str("d"), str("e")])
# Test a directory # Test a directory
def test_iter_dict(self): def test_iter_dict(self):
dict = {} dict = {}
...@@ -500,7 +493,6 @@ class TestCase(unittest.TestCase): ...@@ -500,7 +493,6 @@ class TestCase(unittest.TestCase):
for y in NoGuessLen5(), Guess3Len5(), Guess30Len5(): for y in NoGuessLen5(), Guess3Len5(), Guess30Len5():
self.assertEqual(lzip(x, y), expected) self.assertEqual(lzip(x, y), expected)
# This test case will be removed if we don't have Unicode
def test_unicode_join_endcase(self): def test_unicode_join_endcase(self):
# This class inserts a Unicode object into its argument's natural # This class inserts a Unicode object into its argument's natural
...@@ -517,7 +509,7 @@ class TestCase(unittest.TestCase): ...@@ -517,7 +509,7 @@ class TestCase(unittest.TestCase):
i = self.i i = self.i
self.i = i+1 self.i = i+1
if i == 2: if i == 2:
return str("fooled you!") return "fooled you!"
return next(self.it) return next(self.it)
f = open(TESTFN, "w") f = open(TESTFN, "w")
...@@ -541,8 +533,6 @@ class TestCase(unittest.TestCase): ...@@ -541,8 +533,6 @@ class TestCase(unittest.TestCase):
unlink(TESTFN) unlink(TESTFN)
except OSError: except OSError:
pass pass
if not have_unicode:
def test_unicode_join_endcase(self): pass
# Test iterators with 'x in y' and 'x not in y'. # Test iterators with 'x in y' and 'x not in y'.
def test_in_and_not_in(self): def test_in_and_not_in(self):
......
"""Test compiler changes for unary ops (+, -, ~) introduced in Python 2.2""" """Test compiler changes for unary ops (+, -, ~) introduced in Python 2.2"""
import unittest import unittest
from test.test_support import run_unittest, have_unicode from test.test_support import run_unittest
class UnaryOpTestCase(unittest.TestCase): class UnaryOpTestCase(unittest.TestCase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment