Code review comment for lp:~veebers/unity8/update_ap_tests_ready_for_py3

Revision history for this message
Martin Pitt (pitti) wrote :

61 - data_path = "/usr/share/unity8/mocks/data"
62 + data_path = u"/usr/share/unity8/mocks/data"

Why are these kinds of changes necessary? "foo" is already a string in Python 3, and Python 2 mostly doesn't care (and obviously the tests currently work with intermixing bytes and strings). The u"" form is deprecated in Python 3, and in fact got removed entirely in 3.0 to 3.2 before it was reintroduced in 3.3 for backwards compat support.

145 - if not isinstance(code, basestring):
147 + if not isinstance(code, str):

Is there a chance that you'll get an unicode object in the tests when running with Python 2? I suppose you ran the py2 tests with this branch and it worked, but just making double-sure.

LGTM otherwise, thanks!

review: Needs Information

« Back to merge proposal