Commits

Travis Shirk committed 044a332

Fix tests for Python 2.6 compat (unittest2 asserts, skipIf, etc.)

  • Participants
  • Parent commits 655aa5e
  • Branches stable

Comments (0)

Files changed (8)

File src/test/__init__.py

             if not s.isatty():
                 s.seek(self._seek_offset)
         sys.stdout, sys.stderr = self._orig_stdout, self._orig_stderr
+
+#if sys.version_info[1] == 6:
+

File src/test/id3/test_frames.py

                        UTF_16BE_ENCODING)
 from eyed3.id3 import ID3_V1_0, ID3_V1_1, ID3_V2_2, ID3_V2_3, ID3_V2_4
 from eyed3.id3.frames import *
+from ..compat import *
+
 
 class FrameTest(unittest.TestCase):
     def testCtor(self):

File src/test/id3/test_headers.py

 from eyed3.utils.binfuncs import dec2bin, bin2bytes, bin2synchsafe
 from eyed3.id3.headers import *
 from eyed3.id3 import ID3_DEFAULT_VERSION, TagException
+from ..compat import *
+
 
 class TestTagHeader(unittest.TestCase):
     def testCtor(self):

File src/test/id3/test_tag.py

 from eyed3.core import Date
 from eyed3.id3 import Tag, ID3_DEFAULT_VERSION, ID3_V2_3, ID3_V2_4
 from eyed3.id3 import frames
+from ..compat import *
+
 
 def testTagImport():
     import eyed3.id3, eyed3.id3.tag

File src/test/mp3/test_mp3.py

 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
 ################################################################################
-import os, StringIO, unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+    import unittest2 as unittest
+else:
+    import unittest
+import os
+import StringIO
 from nose.tools import *
 from .. import DATA_D
 

File src/test/test__init__.py

 ################################################################################
 from nose.tools import *
 import eyed3
+from .compat import *
+
 
 def testLocale():
     assert_true(eyed3.LOCAL_ENCODING)

File src/test/test_classic_plugin.py

 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
 ################################################################################
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+    import unittest2 as unittest
+else:
+    import unittest
 import os, shutil
 from nose.tools import *
 import eyed3
 from eyed3 import main, id3, core
 from . import DATA_D, RedirectStdStreams
+from .compat import *
 
 def testPluginOption():
     for arg in ["--help", "-h"]:

File src/test/test_plugins.py

 from nose.tools import *
 from eyed3.plugins import *
 from eyed3.plugins import examples, classic
+from .compat import *
+
 
 def test_load():
     plugins = load()