Commits

Vinay Sajip  committed 4f3b053

Removed debug code.

  • Participants
  • Parent commits 335c073

Comments (0)

Files changed (2)

 
 import array
 import codecs
-import logging
 import os
 import re
 import struct
 import sys
 import textwrap
 
-logger = logging.getLogger(__name__)
-
 if sys.version_info[:2] < (3, 0):
     PY3 = False
     text_type = unicode
             ret += self._str_field("msgstr", delflag, "", self.msgstr, wrapwidth)
         ret.append('')
         ret = u('\n').join(ret)
-        assert isinstance(ret, text_type)
-        #if not isinstance(ret, text_type):
-        #    ret = ret.decode(self.encoding)
-        logger.debug('_BaseEntry.__unicode__ data:\n%s', self.__dict__)
-        logger.debug('_BaseEntry.__unicode__ return:\n%s', ret)
         return ret
 
     if PY3:
             for k in msgstr_plural:
                 msgstr_plural[k] = msgstr_plural[k].decode(encoding)
             kwargs['msgstr_plural'] = msgstr_plural
-        logger.debug('MOEntry: %s', kwargs)
         return MOEntry(**kwargs)
 
     def _readbinary(self, fmt, numbytes):

File tests/tests.py

 # -*- coding: utf-8 -*-
 
 import codecs
-import logging
 import os
 import subprocess
 import sys
 
 from polib import u
 
-logger = logging.getLogger('tests')
-
 class TestFunctions(unittest.TestCase):
 
     def test_pofile_and_mofile1(self):
         """
         Test for the MOFile.save_as_pofile() method.
         """
-        logger.debug('Test started: test_save_as_pofile')
+        fd, tmpfile = tempfile.mkstemp()
+        os.close(fd)
+        mo = polib.mofile('tests/test_utf8.mo', wrapwidth=78)
+        mo.save_as_pofile(tmpfile)
         try:
-            fd, tmpfile = tempfile.mkstemp()
-            os.close(fd)
-            mo = polib.mofile('tests/test_utf8.mo', wrapwidth=78)
-            logger.debug('Read mo file, saving as po file')
-            mo.save_as_pofile(tmpfile)
-            logger.debug('Done po file save')
-            try:
-                f = open(tmpfile)
-                s1 = f.read()
-                f.close()
-                f = open('tests/test_save_as_pofile.po')
-                s2 = f.read()
-                f.close()
-                self.assertEqual(s1, s2)
-            finally:
-                os.remove(tmpfile)
+            f = open(tmpfile)
+            s1 = f.read()
+            f.close()
+            f = open('tests/test_save_as_pofile.po')
+            s2 = f.read()
+            f.close()
+            self.assertEqual(s1, s2)
         finally:
-            logger.debug('Test ended: test_save_as_pofile')
+            os.remove(tmpfile)
         
     def test_msgctxt(self):
         #import pdb; pdb.set_trace()
         self.assertEqual(ret, expected)
 
 if __name__ == '__main__':
-    logging.basicConfig(level=logging.DEBUG, filename='polib.log',
-                        filemode='w', format='%(asctime)s %(levelname)-8s '
-                                             '%(name)s %(message)s')
     unittest.main()