Code review comment for lp:~mbp/bzr/deprecation

Revision history for this message
Vincent Ladeuil (vila) wrote :

24 + saved_user_encoding = osutils._cached_user_encoding
25 + saved_stdout = sys.stdout
26 + def restore_stuff():
27 + osutils._cached_user_encoding = saved_user_encoding
28 + sys.stdout = saved_stdout
29 + self.addCleanup(restore_stuff)

You missed the even simpler:

self.overrideAttr(sys, 'stdout')
self.overrideAttr(osutils._cached_user_encoding)

which will set an illegal value that could even catch invalid tests there.

And looking at the tests, you don't even need to override sys.stdout anyway.

Hmm, your branch seems to be based on a bzr version that doesn't provide overrideAttr,
yet you target bzr.dev, is that really wanted ?

=== modified file 'bzrlib/tests/test_http.py'

Same remarks, plus it will conflict with my lealing-tests proposal, but I'll handle the conflicts there (I've addressed the same problem :)

This is still better than what we have so feel free to land whatever version you want, my vote is optional Tweak here :)

review: Needs Fixing

« Back to merge proposal