test_encodingutil: use self.patch rather than modifying encodingutil.io_encoding directly.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2015-11-02 21:42:42 +00:00
parent bafac70c13
commit cc42b20f97

View File

@ -400,13 +400,13 @@ class QuoteOutput(ReallyEqualMixin, unittest.TestCase):
check(u"\n", u"\"\\x0a\"", quote_newlines=True)
def test_quote_output_default(self):
encodingutil.io_encoding = 'ascii'
self.patch(encodingutil, 'io_encoding', 'ascii')
self.test_quote_output_ascii(None)
encodingutil.io_encoding = 'latin1'
self.patch(encodingutil, 'io_encoding', 'latin1')
self.test_quote_output_latin1(None)
encodingutil.io_encoding = 'utf-8'
self.patch(encodingutil, 'io_encoding', 'utf-8')
self.test_quote_output_utf8(None)