From: Daira Hopwood <daira@jacaranda.org>
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/components/%22news.html/COPYING.GPL?a=commitdiff_plain;h=0725b627f581f00c66ac493b07169202f2ef098c;p=tahoe-lafs%2Ftahoe-lafs.git

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

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
---

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)