From: Daira Hopwood Date: Mon, 2 Nov 2015 21:42:42 +0000 (+0000) Subject: test_encodingutil: use self.patch rather than modifying encodingutil.io_encoding... X-Git-Url: https://git.rkrishnan.org/Site/Content/Exhibitors/provisioning?a=commitdiff_plain;h=cc42b20f972a7eb5cab0d9d4102b8b241ebacaf1;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)