← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1598062] Re: Unit test fails on python3.5

 

Reviewed:  https://review.openstack.org/336443
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b7033277dc19493b4a53705b5ecae7c3c77da999
Submitter: Jenkins
Branch:    master

commit b7033277dc19493b4a53705b5ecae7c3c77da999
Author: Jens Rosenboom <j.rosenboom@xxxxxxxx>
Date:   Fri Jul 1 10:58:12 2016 +0200

    Fix api_validation for Python 3
    
    * Convert argument to base64.decodestring() to bytes for PY3.
    * Fix an issue with python3.5 where the format of an internal error
      message changed.
    
    Change-Id: If8184c190e76d8cefb5b097f8fa8cb7564207103
    Closes-Bug: 1598062


** Changed in: nova
       Status: Confirmed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1598062

Title:
  Unit test fails on python3.5

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  This is similar to https://launchpad.net/bugs/1559191 but in this case
  it looks like the embedded error message comes from the jsonschema
  library:

  ==============================
  Failed 1 tests - output below:
  ==============================

  nova.tests.unit.test_api_validation.PatternPropertiesTestCase.test_validate_patternProperties_fails
  ---------------------------------------------------------------------------------------------------

  Captured traceback:
  ~~~~~~~~~~~~~~~~~~~
      b'Traceback (most recent call last):'
      b'  File "/home/ubuntu/src/nova/nova/api/validation/validators.py", line 258, in validate'
      b'    self.validator.validate(*args, **kwargs)'
      b'  File "/home/ubuntu/src/nova/.tox/py35/lib/python3.5/site-packages/jsonschema/validators.py", line 122, in validate'
      b'    for error in self.iter_errors(*args, **kwargs):'
      b'  File "/home/ubuntu/src/nova/.tox/py35/lib/python3.5/site-packages/jsonschema/validators.py", line 98, in iter_errors'
      b'    for error in errors:'
      b'  File "/home/ubuntu/src/nova/.tox/py35/lib/python3.5/site-packages/jsonschema/_validators.py", line 25, in additionalProperties'
      b'    extras = set(_utils.find_additional_properties(instance, schema))'
      b'  File "/home/ubuntu/src/nova/.tox/py35/lib/python3.5/site-packages/jsonschema/_utils.py", line 100, in find_additional_properties'
      b'    if patterns and re.search(patterns, property):'
      b'  File "/home/ubuntu/src/nova/.tox/py35/lib/python3.5/re.py", line 173, in search'
      b'    return _compile(pattern, flags).search(string)'
      b'TypeError: expected string or bytes-like object'
      b''
      b'During handling of the above exception, another exception occurred:'
      b''
      b'Traceback (most recent call last):'
      b'  File "/home/ubuntu/src/nova/nova/tests/unit/test_api_validation.py", line 101, in check_validation_error'
      b'    method(body=body, req=req,)'
      b'  File "/home/ubuntu/src/nova/nova/api/validation/__init__.py", line 71, in wrapper'
      b"    schema_validator.validate(kwargs['body'])"
      b'  File "/home/ubuntu/src/nova/nova/api/validation/validators.py", line 277, in validate'
      b'    raise exception.ValidationError(detail=detail)'
      b'nova.exception.ValidationError: expected string or bytes-like object'
      b''
      b'During handling of the above exception, another exception occurred:'
      b''
      b'Traceback (most recent call last):'
      b'  File "/home/ubuntu/src/nova/nova/tests/unit/test_api_validation.py", line 359, in test_validate_patternProperties_fails'
      b'    expected_detail=detail)'
      b'  File "/home/ubuntu/src/nova/nova/tests/unit/test_api_validation.py", line 106, in check_validation_error'
      b"    'Exception details did not match expected')"
      b'  File "/home/ubuntu/src/nova/.tox/py35/lib/python3.5/site-packages/testtools/testcase.py", line 411, in assertEqual'
      b'    self.assertThat(observed, matcher, message)'
      b'  File "/home/ubuntu/src/nova/.tox/py35/lib/python3.5/site-packages/testtools/testcase.py", line 498, in assertThat'
      b'    raise mismatch_error'
      b"testtools.matchers._impl.MismatchError: 'expected string or buffer' != 'expected string or bytes-like object': Exception details did not match expected"
      b''

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1598062/+subscriptions


References