test failures on newer Python: assertWarns() arg1 must be a warning type

Bug #1514210 reported by Jelmer Vernooij on 2015-11-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Medium
Vincent Ladeuil

Bug Description

======================================================================
ERROR: bzrlib.tests.test_config.TestListOption.test_convert_invalid
----------------------------------------------------------------------
Traceback (most recent call last):
testtools.testresult.real._StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/<<BUILDDIR>>/bzr-2.6.0+bzr6606/build/lib.linux-x86_64-2.7/bzrlib/tests/test_config.py", line 2410, in test_convert_invalid
    self.assertConvertInvalid(opt, [1])
  File "/<<BUILDDIR>>/bzr-2.6.0+bzr6606/build/lib.linux-x86_64-2.7/bzrlib/tests/test_config.py", line 2333, in assertConvertInvalid
    self.assertWarns(opt, invalid_value)
  File "/usr/lib/python2.7/dist-packages/unittest2/case.py", line 776, in assertWarns
    return context.handle('assertWarns', args, kwargs)
  File "/usr/lib/python2.7/dist-packages/unittest2/case.py", line 174, in handle
    (name, self._base_type_str))
TypeError: assertWarns() arg 1 must be a warning type or tuple of warning types

======================================================================
ERROR: bzrlib.tests.test_config.TestOptionWithBooleanConverter.test_convert_invalid
----------------------------------------------------------------------
Traceback (most recent call last):
testtools.testresult.real._StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/<<BUILDDIR>>/bzr-2.6.0+bzr6606/build/lib.linux-x86_64-2.7/bzrlib/tests/test_config.py", line 2347, in test_convert_invalid
    self.assertConvertInvalid(opt, u'invalid-boolean')
  File "/<<BUILDDIR>>/bzr-2.6.0+bzr6606/build/lib.linux-x86_64-2.7/bzrlib/tests/test_config.py", line 2333, in assertConvertInvalid
    self.assertWarns(opt, invalid_value)
  File "/usr/lib/python2.7/dist-packages/unittest2/case.py", line 776, in assertWarns
    return context.handle('assertWarns', args, kwargs)
  File "/usr/lib/python2.7/dist-packages/unittest2/case.py", line 174, in handle
    (name, self._base_type_str))
TypeError: assertWarns() arg 1 must be a warning type or tuple of warning types

======================================================================
ERROR: bzrlib.tests.test_config.TestOptionWithSIUnitConverter.test_convert_invalid
----------------------------------------------------------------------
Traceback (most recent call last):
testtools.testresult.real._StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/<<BUILDDIR>>/bzr-2.6.0+bzr6606/build/lib.linux-x86_64-2.7/bzrlib/tests/test_config.py", line 2384, in test_convert_invalid
    self.assertConvertInvalid(opt, u'not-a-unit')
  File "/<<BUILDDIR>>/bzr-2.6.0+bzr6606/build/lib.linux-x86_64-2.7/bzrlib/tests/test_config.py", line 2333, in assertConvertInvalid
    self.assertWarns(opt, invalid_value)
  File "/usr/lib/python2.7/dist-packages/unittest2/case.py", line 776, in assertWarns
    return context.handle('assertWarns', args, kwargs)
  File "/usr/lib/python2.7/dist-packages/unittest2/case.py", line 174, in handle
    (name, self._base_type_str))
TypeError: assertWarns() arg 1 must be a warning type or tuple of warning types

======================================================================
ERROR: bzrlib.tests.test_config.TestOptionWithIntegerConverter.test_convert_invalid
----------------------------------------------------------------------
Traceback (most recent call last):
testtools.testresult.real._StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/<<BUILDDIR>>/bzr-2.6.0+bzr6606/build/lib.linux-x86_64-2.7/bzrlib/tests/test_config.py", line 2367, in test_convert_invalid
    self.assertConvertInvalid(opt, u'forty-two')
  File "/<<BUILDDIR>>/bzr-2.6.0+bzr6606/build/lib.linux-x86_64-2.7/bzrlib/tests/test_config.py", line 2333, in assertConvertInvalid
    self.assertWarns(opt, invalid_value)
  File "/usr/lib/python2.7/dist-packages/unittest2/case.py", line 776, in assertWarns
    return context.handle('assertWarns', args, kwargs)
  File "/usr/lib/python2.7/dist-packages/unittest2/case.py", line 174, in handle
    (name, self._base_type_str))
TypeError: assertWarns() arg 1 must be a warning type or tuple of warning types

======================================================================
ERROR: bzrlib.tests.test_config.TestRegistryOption.test_convert_invalid
----------------------------------------------------------------------
Traceback (most recent call last):
testtools.testresult.real._StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/<<BUILDDIR>>/bzr-2.6.0+bzr6606/build/lib.linux-x86_64-2.7/bzrlib/tests/test_config.py", line 2435, in test_convert_invalid
    self.assertConvertInvalid(opt, [1])
  File "/<<BUILDDIR>>/bzr-2.6.0+bzr6606/build/lib.linux-x86_64-2.7/bzrlib/tests/test_config.py", line 2333, in assertConvertInvalid
    self.assertWarns(opt, invalid_value)
  File "/usr/lib/python2.7/dist-packages/unittest2/case.py", line 776, in assertWarns
    return context.handle('assertWarns', args, kwargs)
  File "/usr/lib/python2.7/dist-packages/unittest2/case.py", line 174, in handle
    (name, self._base_type_str))
TypeError: assertWarns() arg 1 must be a warning type or tuple of warning types

----------------------------------------------------------------------
Ran 28534 tests in 459.580s

FAILED (errors=5, known_failure_count=60)

Related branches

Vincent Ladeuil (vila) wrote :

Hmpf.

The errors are confusing, the root issue is using a mixin defining a method that out of the blue is introduced in unittest2 (huh ?) in upstream python (yeah compatibility).

Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
status: New → In Progress
Vincent Ladeuil (vila) on 2016-01-14
Changed in bzr:
importance: Undecided → Medium
milestone: none → 2.7b1
Vincent Ladeuil (vila) on 2016-01-21
Changed in bzr:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers