[Python-projects] logilab-common-0.51.1 fails tests with Python 2.7

Arfrever Frehtes Taifersar Arahesis arfrever.fta at gmail.com
Sat Sep 18 23:41:48 CEST 2010


logilab-common-0.51.1 fails all tests with Python 2.7. Example:

=========================  unittest_html.py  =========================
unhandled exception occurred while testing unittest_html
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/pytest.py", line 433, in testfile
    options=self.options, outstream=sys.stderr)
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 955, in unittest_main
    cvg, options, outstream)
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 721, in __init__
    testLoader=NonStrictTestLoader())
  File "/usr/lib64/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 776, in parseArgs
    self.test = self.testLoader.loadTestsFromModule(self.module)
  File "/usr/lib64/python2.7/unittest/loader.py", line 65, in loadTestsFromModule
    tests.append(self.loadTestsFromTestCase(obj))
  File "/usr/lib64/python2.7/unittest/loader.py", line 56, in loadTestsFromTestCase
    loaded_suite = self.suiteClass(map(testCaseClass, testCaseNames))
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 1027, in __init__
    self.__exc_info = self._exc_info
AttributeError: 'UIlibHTMLGenerationTC' object has no attribute '_exc_info'

I'm attaching the patch, which fixes majority of test failures specific to Python 2.7.
The following error still occurs after applying this patch:

=======================  unittest_testlib.py  ========================
test_require_module_bad (unittest_testlib.DecoratorTC)
should return a different function : skipping test ... ok
test_require_module_good (unittest_testlib.DecoratorTC)
should return the same function ... ok
test_require_version_bad (unittest_testlib.DecoratorTC)
should return a different function : skipping test ... ok
test_require_version_exception (unittest_testlib.DecoratorTC)
should throw a ValueError exception ... ok
test_require_version_good (unittest_testlib.DecoratorTC)
should return the same function ... ok
test_tmp_dir_normal (unittest_testlib.DecoratorTC) ... ok
test_error_exit_first (unittest_testlib.ExitFirstTC) ... ok
test_failure_exit_first (unittest_testlib.ExitFirstTC) ... ok
test_generative_exit_first (unittest_testlib.ExitFirstTC) ... ok
test_generative_error (unittest_testlib.GenerativeTestsTC) ... ok
test_generative_error2 (unittest_testlib.GenerativeTestsTC) ... ok
test_generative_half_bad (unittest_testlib.GenerativeTestsTC) ... ok
test_generative_inner_error (unittest_testlib.GenerativeTestsTC) ... ok
test_generative_inner_failure (unittest_testlib.GenerativeTestsTC) ... ok
test_generative_inner_skip (unittest_testlib.GenerativeTestsTC) ... ok
test_generative_ok (unittest_testlib.GenerativeTestsTC) ... ok
test_generative_setup (unittest_testlib.GenerativeTestsTC) ... ok
test_generative_skip (unittest_testlib.GenerativeTestsTC) ... ok
test_encoded_non_ascii_messages (unittest_testlib.OutErrCaptureTC) ... ok
test_no_capture (unittest_testlib.OutErrCaptureTC) ... ok
test_stderr_capture (unittest_testlib.OutErrCaptureTC) ... ok
test_stdout_capture (unittest_testlib.OutErrCaptureTC) ... ok
test_unicode_non_ascii_messages (unittest_testlib.OutErrCaptureTC) ... ok
test_tag_decorator (unittest_testlib.TagTC) ... ok
test_tagged_class (unittest_testlib.TagTC) ... ok
test_tags_class (unittest_testlib.TagTC) ... ok
test_tags_match (unittest_testlib.TagTC) ... ok
test__classes_are_ignored (unittest_testlib.TestLoaderTC) ... ok
test_collect_everything (unittest_testlib.TestLoaderTC)
make sure we don't change the default behaviour ... ok
test_collect_everything_and_skipped_patterns (unittest_testlib.TestLoaderTC) ... ok
ok
ok
test_collect_specific_pattern_and_skip_some (unittest_testlib.TestLoaderTC) ... ok
ok
ok
test_collect_with_classname (unittest_testlib.TestLoaderTC) ... ok
test_collect_with_classname_and_pattern (unittest_testlib.TestLoaderTC) ... ok
ok
ok
ok
ok
ok
test_collect_with_pattern (unittest_testlib.TestLoaderTC) ... ok
ok
ok
ok
ok
ok
ok
ok
ok
test_inner_tests_selection (unittest_testlib.TestLoaderTC) ... ok
ok
ok
ok
test_nonregr_class_skipped_option (unittest_testlib.TestLoaderTC) ... ok
test_nonregr_dotted_path (unittest_testlib.TestLoaderTC) ... ok
test_skip_classname (unittest_testlib.TestLoaderTC) ... ok
ok
test_skip_classname_and_specific_collect (unittest_testlib.TestLoaderTC) ... ok
ok
test_tescase_with_custom_metaclass (unittest_testlib.TestLoaderTC) ... ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
test_assert_raises (unittest_testlib.TestlibTC) ... ok
test_cached_datadir (unittest_testlib.TestlibTC)
test datadir is cached on the class ... ok
test_custom_datadir (unittest_testlib.TestlibTC) ... SKIPPED
test_default_datadir (unittest_testlib.TestlibTC) ... ok
test_dict_equals (unittest_testlib.TestlibTC)
tests TestCase.assertDictEquals ... ok
test_dir_equality (unittest_testlib.TestlibTC) ... ok
test_file_equality (unittest_testlib.TestlibTC) ... ok
test_in (unittest_testlib.TestlibTC) ... ok
test_is (unittest_testlib.TestlibTC) ... ok
test_isnot (unittest_testlib.TestlibTC) ... ok
test_lines_equals (unittest_testlib.TestlibTC)
tests assertLineEquals ... ok
test_list_equals (unittest_testlib.TestlibTC)
tests TestCase.assertListEquals ... ok
test_multiple_args_datadir (unittest_testlib.TestlibTC) ... ok
test_none (unittest_testlib.TestlibTC) ... ok
test_not_in (unittest_testlib.TestlibTC) ... ok
test_stream_equality (unittest_testlib.TestlibTC) ... ok
test_text_equality (unittest_testlib.TestlibTC) ... ok
test_unordered_equality_for_dicts (unittest_testlib.TestlibTC) ... ok
test_unordered_equality_for_iterables (unittest_testlib.TestlibTC) ... ok
test_unordered_equality_for_lists (unittest_testlib.TestlibTC) ... ok
test_xml_valid (unittest_testlib.TestlibTC)
tests xml is valid ... unhandled exception occurred while testing unittest_testlib
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/pytest.py", line 433, in testfile
    options=self.options, outstream=sys.stderr)
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 955, in unittest_main
    cvg, options, outstream)
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 721, in __init__
    testLoader=NonStrictTestLoader())
  File "/usr/lib64/python2.7/unittest/main.py", line 95, in __init__
    self.runTests()
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 793, in runTests
    return self._runTests()
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 846, in _runTests
    result = self.testRunner.run(self.test)
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 527, in run
    test(result, self._runcondition, self.options)
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 445, in __call__
    return self.run(*args, **kwds)
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 430, in run
    test(result, runcondition, options)
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 445, in __call__
    return self.run(*args, **kwds)
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 430, in run
    test(result, runcondition, options)
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 1170, in __call__
    status = self._proceed(result, testMethod)
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 1258, in _proceed
    result.addError(self, self.__exc_info())
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 362, in addError
    super(SkipAwareTestResult, self).addError(test, err)
  File "/usr/lib64/python2.7/unittest/runner.py", line 66, in addError
    super(TextTestResult, self).addError(test, err)
  File "/usr/lib64/python2.7/unittest/result.py", line 19, in inner
    return method(self, *args, **kw)
  File "/usr/lib64/python2.7/unittest/result.py", line 109, in addError
    self.errors.append((test, self._exc_info_to_string(err, test)))
  File "/var/tmp/portage/dev-python/logilab-common-0.51.1/temp/test-2.7/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 347, in _exc_info_to_string
    output.append('      self.%s: %r' % (varname, value))
  File "/usr/lib64/python2.7/unittest/case.py", line 275, in __repr__
    (strclass(self.__class__), self._testMethodName)
AttributeError: 'MockTestCase' object has no attribute '_testMethodName'

-- 
Arfrever Frehtes Taifersar Arahesis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logilab-common-0.51.1-python-2.7.patch
Type: text/x-patch
Size: 587 bytes
Desc: not available
URL: <http://lists.logilab.org/pipermail/python-projects/attachments/20100918/59393426/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.logilab.org/pipermail/python-projects/attachments/20100918/59393426/attachment.pgp>


More information about the Python-Projects mailing list