Unit test test_validate_patternProperties_fails fails under Python 3.6

Bug #1749929 reported by Thomas Goirand
This bug report is a duplicate of:  Bug #1749953: Add support for Python 3.6. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Unassigned

Bug Description

Running unit tests under Python 3.6 fails while working in Python 2.7:

cinder.tests.unit.api.test_api_validation.PatternPropertiesTestCase.test_validate_patternProperties_fails
---------------------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/zigo/sources/openstack/queens/services/cinder/build-area/cinder-12.0.0~rc1/cinder/api/validation/validators.py", line 208, in validate'
    b' self.validator.validate(*args, **kwargs)'
    b' File "/usr/lib/python3/dist-packages/jsonschema/validators.py", line 129, in validate'
    b' for error in self.iter_errors(*args, **kwargs):'
    b' File "/usr/lib/python3/dist-packages/jsonschema/validators.py", line 105, in iter_errors'
    b' for error in errors:'
    b' File "/usr/lib/python3/dist-packages/jsonschema/_validators.py", line 14, in patternProperties'
    b' if re.search(pattern, k):'
    b' File "/usr/lib/python3.6/re.py", line 182, 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/zigo/sources/openstack/queens/services/cinder/build-area/cinder-12.0.0~rc1/cinder/tests/unit/api/test_api_validation.py", line 95, in check_validation_error'
    b' method(body=body, req=req,)'
    b' File "/home/zigo/sources/openstack/queens/services/cinder/build-area/cinder-12.0.0~rc1/cinder/api/validation/__init__.py", line 59, in wrapper'
    b" schema_validator.validate(kwargs['body'])"
    b' File "/home/zigo/sources/openstack/queens/services/cinder/build-area/cinder-12.0.0~rc1/cinder/api/validation/validators.py", line 225, in validate'
    b' raise exception.ValidationError(detail=detail)'
    b'cinder.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/zigo/sources/openstack/queens/services/cinder/build-area/cinder-12.0.0~rc1/cinder/tests/unit/api/test_api_validation.py", line 247, in test_validate_patternProperties_fails'
    b' expected_detail=detail)'
    b' File "/home/zigo/sources/openstack/queens/services/cinder/build-area/cinder-12.0.0~rc1/cinder/tests/unit/api/test_api_validation.py", line 103, in check_validation_error'
    b" 'Exception details did not match expected')"
    b' File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 411, in assertEqual'
    b' self.assertThat(observed, matcher, message)'
    b' File "/usr/lib/python3/dist-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"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.