From: Daira Hopwood Date: Mon, 28 Dec 2015 20:34:41 +0000 (+0000) Subject: test_encodingutil: use self.patch rather than modifying encodingutil.io_encoding... X-Git-Url: https://git.rkrishnan.org/pf/content/en/service/cyclelanguage?a=commitdiff_plain;h=1f7069e622844e5404b3b33c9897e147a95c637f;p=tahoe-lafs%2Ftahoe-lafs.git test_encodingutil: use self.patch rather than modifying encodingutil.io_encoding directly. Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/test/test_encodingutil.py b/src/allmydata/test/test_encodingutil.py index 1b700e99..9d6fe8f3 100644 --- a/src/allmydata/test/test_encodingutil.py +++ b/src/allmydata/test/test_encodingutil.py @@ -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)