Kaydet (Commit) 2f677561 authored tarafından Michael Foord's avatar Michael Foord

Silence UnicodeWarning in crazy unittest test.

üst 92cb4a8c
...@@ -16,6 +16,7 @@ import types ...@@ -16,6 +16,7 @@ import types
from copy import deepcopy from copy import deepcopy
from cStringIO import StringIO from cStringIO import StringIO
import pickle import pickle
import warnings
### Support code ### Support code
...@@ -2573,6 +2574,8 @@ class Test_TestCase(TestCase, TestEquality, TestHashing): ...@@ -2573,6 +2574,8 @@ class Test_TestCase(TestCase, TestEquality, TestHashing):
with self.assertRaises(self.failureException): with self.assertRaises(self.failureException):
self.assertDictContainsSubset({'a': 1, 'c': 1}, {'a': 1}) self.assertDictContainsSubset({'a': 1, 'c': 1}, {'a': 1})
with warnings.catch_warnings(record=True):
# silence the UnicodeWarning
one = ''.join(chr(i) for i in range(255)) one = ''.join(chr(i) for i in range(255))
# this used to cause a UnicodeDecodeError constructing the failure msg # this used to cause a UnicodeDecodeError constructing the failure msg
with self.assertRaises(self.failureException): with self.assertRaises(self.failureException):
......
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