tempest unit test tempest.tests.lib.services.test_clients.TestClientsFactory.test___init___no_module fails on py36

Bug #1664454 reported by Matthew Treinish
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Low
Masayuki Igawa

Bug Description

When running the tempest unit tests under python 3.6 they consistently fail with this error:

tempest.tests.lib.services.test_clients.TestClientsFactory.test___init___no_module
----------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/computertreker/git/tempest/tempest/tests/lib/services/test_clients.py", line 104, in test___init___no_module'
    b' auth_provider)'
    b' File "/home/computertreker/git/tempest/tempest/lib/services/clients.py", line 176, in __init__'
    b' _module = importlib.import_module(module_path)'
    b' File "/home/computertreker/git/tempest/.tox/py36/lib/python3.6/importlib/__init__.py", line 126, in import_module'
    b' return _bootstrap._gcd_import(name[level:], package, level)'
    b' File "<frozen importlib._bootstrap>", line 978, in _gcd_import'
    b' File "<frozen importlib._bootstrap>", line 961, in _find_and_load'
    b' File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked'
    b"ModuleNotFoundError: No module named 'fake_module'"
    b''

it looks like we're either mocking too specific a thing that no longer works on 3.6 or failing to mock something extra needed on py3.6. But, I haven't looked too closely yet, and it's not super critical since we won't be testing py36 in the gate for a while

Changed in tempest:
status: New → Confirmed
Changed in tempest:
assignee: nobody → Masayuki Igawa (igawa)
status: Confirmed → In Progress
Revision history for this message
Masayuki Igawa (igawa) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/453430
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=56e7f38a2fe14815e5757b2f3472cd8c25482853
Submitter: Jenkins
Branch: master

commit 56e7f38a2fe14815e5757b2f3472cd8c25482853
Author: Masayuki Igawa <email address hidden>
Date: Wed Apr 5 10:25:01 2017 +0900

    Fix no module unit test for Python3.6

    This commit fixes a unit test of 'test___init___no_module' for
    Python3.6. From Python3.6, the error has been changed to
    raise a ModuleNotFoundError (subclass of ImportError) when it cannot
    find a module[1]. We should keep tempest working on Python3.6 although
    we actually don't have py36 gate job now.

    So, The testtools.ExpectedException is too strict in this situation. So
    I just change it to use assertRaises. This is a bit loose to check
    however, I was thinking introducing checking the semver was a bit
    overkill here.

    [1] https://docs.python.org/3/whatsnew/3.6.html#other-language-changes

    Change-Id: I21dc50f20671780f2704d8dd18ca72e0628c8c68
    Closes-Bug: #1664454

Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tempest 16.0.0

This issue was fixed in the openstack/tempest 16.0.0 release.

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.