Comment 0 for bug 1815657

Revision history for this message
Corey Bryant (corey.bryant) wrote : python 3.7 unit test failures

There are 2 unit tests failing with python 3.7. This can be recreated on Ubuntu Disco by running the py35 target which by default will use python3 which is /usr/bin/python3 which is python3.7 in Disco. python3.7 is also available in bionic so you can likely update tox.ini to specifically use python3.7.

==============================
Failed 2 tests - output below:
==============================

masakari.tests.unit.test_hacking.HackingTestCase.test_check_doubled_words
-------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/corey/pkg/stein/upstream/masakari/masakari/tests/unit/test_hacking.py", line 371, in test_check_doubled_words'
    b' expected_errors=errors)'
    b' File "/home/corey/pkg/stein/upstream/masakari/masakari/tests/unit/test_hacking.py", line 234, in _assert_has_errors'
    b' self.assertEqual(expected_errors or [], actual_errors)'
    b' File "/home/corey/pkg/stein/upstream/masakari/.tox/py35/lib/python3.7/site-packages/testtools/testcase.py", line 411, in assertEqual'
    b' self.assertThat(observed, matcher, message)'
    b' File "/home/corey/pkg/stein/upstream/masakari/.tox/py35/lib/python3.7/site-packages/testtools/testcase.py", line 498, in assertThat'
    b' raise mismatch_error'
    b"testtools.matchers._impl.MismatchError: [(1, 0, 'M325')] != []"
    b''

masakari.tests.unit.test_api_validation.PatternPropertiesTestCase.test_validate_patternProperties_fails
-------------------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/corey/pkg/stein/upstream/masakari/masakari/api/validation/validators.py", line 181, in validate'
    b' self.validator.validate(*args, **kwargs)'
    b' File "/home/corey/pkg/stein/upstream/masakari/.tox/py35/lib/python3.7/site-packages/jsonschema/validators.py", line 129, in validate'
    b' for error in self.iter_errors(*args, **kwargs):'
    b' File "/home/corey/pkg/stein/upstream/masakari/.tox/py35/lib/python3.7/site-packages/jsonschema/validators.py", line 105, in iter_errors'
    b' for error in errors:'
    b' File "/home/corey/pkg/stein/upstream/masakari/.tox/py35/lib/python3.7/site-packages/jsonschema/_validators.py", line 14, in patternProperties'
    b' if re.search(pattern, k):'
    b' File "/home/corey/pkg/stein/upstream/masakari/.tox/py35/lib/python3.7/re.py", line 183, 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/corey/pkg/stein/upstream/masakari/masakari/tests/unit/test_api_validation.py", line 100, in check_validation_error'
    b' method(body=body, req=req,)'
    b' File "/home/corey/pkg/stein/upstream/masakari/masakari/api/validation/__init__.py", line 54, in wrapper'
    b" schema_validator.validate(kwargs['body'])"
    b' File "/home/corey/pkg/stein/upstream/masakari/masakari/api/validation/validators.py", line 198, in validate'
    b' raise exception.ValidationError(detail=detail)'
    b'masakari.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/corey/pkg/stein/upstream/masakari/masakari/tests/unit/test_api_validation.py", line 278, in test_validate_patternProperties_fails'
    b' expected_detail=detail)'
    b' File "/home/corey/pkg/stein/upstream/masakari/masakari/tests/unit/test_api_validation.py", line 108, in check_validation_error'
    b" 'Exception details did not match expected')"
    b' File "/home/corey/pkg/stein/upstream/masakari/.tox/py35/lib/python3.7/site-packages/testtools/testcase.py", line 411, in assertEqual'
    b' self.assertThat(observed, matcher, message)'
    b' File "/home/corey/pkg/stein/upstream/masakari/.tox/py35/lib/python3.7/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''

======
Totals
======
Ran: 717 tests in 11.7636 sec.
 - Passed: 712
 - Skipped: 3
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 2
Sum of execute time for each test: 29.1769 sec.