Comment 3 for bug 1763535

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/561190
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=5c98984bb6e7912a9074a715148db94ce06db444
Submitter: Zuul
Branch: master

commit 5c98984bb6e7912a9074a715148db94ce06db444
Author: Stephen Finucane <email address hidden>
Date: Fri Apr 13 11:29:55 2018 +0100

    tests: Fix how context managers are mocked

    Two issues here:

    - The mock library provides a 'mock_open' function to mock the 'open'
      builtin's context manager. We should have been using this but were
      not.
    - We were mocking another context manager in a fairly strange way. This
      seems to be causing issues, possibly down to race. We shouldn't do
      that.

    Fix both issues.

    Change-Id: I289b56ae3f9ccd16d72b2ca317e68e6c18b8b313
    Fixes-Bug: #1763535