diff --git a/test/_common.py b/test/_common.py index 9f8b9f146..5b179ed7e 100644 --- a/test/_common.py +++ b/test/_common.py @@ -14,8 +14,7 @@ # included in all copies or substantial portions of the Software. """Some common functionality for beets' test cases.""" -from __future__ import (division, absolute_import, print_function, - unicode_literals) +from __future__ import (division, absolute_import, print_function) import time import sys @@ -102,11 +101,11 @@ def album(lib=None): _item_ident += 1 i = beets.library.Album( artpath=None, - albumartist='some album artist', - albumartist_sort='some sort album artist', - albumartist_credit='some album artist credit', - album='the album', - genre='the genre', + albumartist=u'some album artist', + albumartist_sort=u'some sort album artist', + albumartist_credit=u'some album artist credit', + album=u'the album', + genre=u'the genre', year=2014, month=2, day=5, @@ -170,11 +169,11 @@ class TestCase(unittest.TestCase): def assertExists(self, path): self.assertTrue(os.path.exists(path), - 'file does not exist: {!r}'.format(path)) + u'file does not exist: {!r}'.format(path)) def assertNotExists(self, path): self.assertFalse(os.path.exists(path), - 'file exists: {!r}'.format((path))) + u'file exists: {!r}'.format((path))) class LibTestCase(TestCase): @@ -226,9 +225,9 @@ class InputException(Exception): self.output = output def __str__(self): - msg = "Attempt to read with no input provided." + msg = u"Attempt to read with no input provided." if self.output is not None: - msg += " Output: %s" % self.output + msg += u" Output: %s" % self.output return msg @@ -352,5 +351,5 @@ def slow_test(unused=None): def _id(obj): return obj if 'SKIP_SLOW_TESTS' in os.environ: - return unittest.skip('test is slow') + return unittest.skip(u'test is slow') return _id diff --git a/test/helper.py b/test/helper.py index e2bc42351..9721e7b4c 100644 --- a/test/helper.py +++ b/test/helper.py @@ -31,8 +31,7 @@ information or mock the environment. """ -from __future__ import (division, absolute_import, print_function, - unicode_literals) +from __future__ import (division, absolute_import, print_function) import sys import os @@ -244,7 +243,7 @@ class TestHelper(object): track_no = 0 album_item_count = item_count while album_item_count: - title = 'track {0}'.format(track_no) + title = u'track {0}'.format(track_no) src = os.path.join(_common.RSRC, 'full.mp3') dest = os.path.join(album_dir, '{0}.mp3'.format(title)) if os.path.exists(dest): @@ -527,14 +526,14 @@ def generate_album_info(album_id, track_ids): """ tracks = [generate_track_info(id) for id in track_ids] album = AlbumInfo( - album_id='album info', - album='album info', - artist='album info', - artist_id='album info', + album_id=u'album info', + album=u'album info', + artist=u'album info', + artist_id=u'album info', tracks=tracks, ) for field in ALBUM_INFO_FIELDS: - setattr(album, field, 'album info') + setattr(album, field, u'album info') return album @@ -553,11 +552,11 @@ def generate_track_info(track_id='track info', values={}): string fields are set to "track info". """ track = TrackInfo( - title='track info', + title=u'track info', track_id=track_id, ) for field in TRACK_INFO_FIELDS: - setattr(track, field, 'track info') + setattr(track, field, u'track info') for field, value in values.items(): setattr(track, field, value) return track diff --git a/test/testall.py b/test/testall.py index fa556e364..e8e1d909d 100755 --- a/test/testall.py +++ b/test/testall.py @@ -15,8 +15,7 @@ # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. -from __future__ import (division, absolute_import, print_function, - unicode_literals) +from __future__ import (division, absolute_import, print_function) import os import re