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/%5B/frontends/flags/(%5B%5E?a=commitdiff_plain;h=0b8f70cc74cf20a104c5d27ce4cc194a9029cdd5;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)