mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Silence UnicodeWarning in crazy unittest test.
This commit is contained in:
parent
92cb4a8c6f
commit
2f6775617c
1 changed files with 7 additions and 4 deletions
|
@ -16,6 +16,7 @@ import types
|
|||
from copy import deepcopy
|
||||
from cStringIO import StringIO
|
||||
import pickle
|
||||
import warnings
|
||||
|
||||
|
||||
### Support code
|
||||
|
@ -2573,6 +2574,8 @@ class Test_TestCase(TestCase, TestEquality, TestHashing):
|
|||
with self.assertRaises(self.failureException):
|
||||
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))
|
||||
# this used to cause a UnicodeDecodeError constructing the failure msg
|
||||
with self.assertRaises(self.failureException):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue