summaryrefslogtreecommitdiffstats
path: root/Lib/test/string_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/string_tests.py')
-rw-r--r--Lib/test/string_tests.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py
index 6d87eb6..b2f837b 100644
--- a/Lib/test/string_tests.py
+++ b/Lib/test/string_tests.py
@@ -1295,8 +1295,10 @@ class MixinStrUserStringTest:
('hex', '68656c6c6f20776f726c64'),
('uu', 'begin 666 <data>\n+:&5L;&\\@=V]R;&0 \n \nend\n')]
for encoding, data in codecs:
- self.checkequal(data, 'hello world', 'encode', encoding)
- self.checkequal('hello world', data, 'decode', encoding)
+ with test_support.check_py3k_warnings():
+ self.checkequal(data, 'hello world', 'encode', encoding)
+ with test_support.check_py3k_warnings():
+ self.checkequal('hello world', data, 'decode', encoding)
# zlib is optional, so we make the test optional too...
try:
import zlib
@@ -1304,8 +1306,10 @@ class MixinStrUserStringTest:
pass
else:
data = 'x\x9c\xcbH\xcd\xc9\xc9W(\xcf/\xcaI\x01\x00\x1a\x0b\x04]'
- self.checkequal(data, 'hello world', 'encode', 'zlib')
- self.checkequal('hello world', data, 'decode', 'zlib')
+ with test_support.check_py3k_warnings():
+ self.checkequal(data, 'hello world', 'encode', 'zlib')
+ with test_support.check_py3k_warnings():
+ self.checkequal('hello world', data, 'decode', 'zlib')
self.checkraises(TypeError, 'xyz', 'decode', 42)
self.checkraises(TypeError, 'xyz', 'encode', 42)