Mocking os.path.exists causes failures

When coverage is run on the OpenStack Octavia project with version 4.0 of coverage multiple unit tests fail. However, if those unit tests are run without coverage or with version 3.7.1 of coverage the tests pass.

You can reproduce these errors with the following steps:
1. Checkout Octavia:
git fetch https://review.openstack.org/openstack/octavia refs/changes/48/225548/3 && git checkout FETCH_HEAD
2. Change into the octavia directory: cd octavia
3. Run the example tests:

To test with version 3.7.1 of coverage edit the test-requirements.txt file:
replace: coverage>=3.6
with: coverage!=4.0,>=3.6

Run the above tox tests with the "r" flag to have it reload the python modules. Example:
tox -re cover --
octavia.tests.functional.amphorae.backend.agent.api_server.test_server.ServerTestCase.test_delete_listener

Comments (10)

Yes, we are 100% sure this is not related to the ignore-errors typo as we have fixed that issue in a separate patch.
These are two completely different issues.
With the typo the tests don't run. Here they run but return incorrect results.