Skip to content

Commit 731b1b1

Browse files
committed
Remove relics of str8 (became bytes) and buffer (bytearray) type tests
Remove redundant tests now that str is unicode.
1 parent 0d0db6c commit 731b1b1

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

Lib/test/string_tests.py

-33
Original file line numberDiff line numberDiff line change
@@ -645,14 +645,6 @@ def test_replace(self):
645645
EQ("bobobXbobob", "bobobobXbobobob", "replace", "bobob", "bob")
646646
EQ("BOBOBOB", "BOBOBOB", "replace", "bob", "bobby")
647647

648-
# XXX Commented out. Is there any reason to support buffer objects
649-
# as arguments for str.replace()? GvR
650-
## ba = bytearray('a')
651-
## bb = bytearray('b')
652-
## EQ("bbc", "abc", "replace", ba, bb)
653-
## EQ("aac", "abc", "replace", bb, ba)
654-
655-
#
656648
self.checkequal('one@two!three!', 'one!two!three!', 'replace', '!', '@', 1)
657649
self.checkequal('onetwothree', 'one!two!three!', 'replace', '!', '')
658650
self.checkequal('one@two@three!', 'one!two!three!', 'replace', '!', '@', 2)
@@ -1389,28 +1381,3 @@ class subclass(t):
13891381
s1 = t("abcd")
13901382
s2 = t().join([s1])
13911383
self.assertIs(s1, s2)
1392-
1393-
# Should also test mixed-type join.
1394-
if t is str:
1395-
s1 = subclass("abcd")
1396-
s2 = "".join([s1])
1397-
self.assertIsNot(s1, s2)
1398-
self.assertIs(type(s2), t)
1399-
1400-
s1 = t("abcd")
1401-
s2 = "".join([s1])
1402-
self.assertIs(s1, s2)
1403-
1404-
## elif t is str8:
1405-
## s1 = subclass("abcd")
1406-
## s2 = "".join([s1])
1407-
## self.assertIsNot(s1, s2)
1408-
## self.assertIs(type(s2), str) # promotes!
1409-
1410-
## s1 = t("abcd")
1411-
## s2 = "".join([s1])
1412-
## self.assertIsNot(s1, s2)
1413-
## self.assertIs(type(s2), str) # promotes!
1414-
1415-
else:
1416-
self.fail("unexpected type for MixinStrUnicodeTest %r" % t)

0 commit comments

Comments
 (0)