Comment 7 for bug 1520383

Revision history for this message
Julian Edwards (julian-edwards) wrote : Re: Tests that need policy.json can never find it

Hey, thanks for the response Lance. I mostly understand how the policy file is loaded but I'm either missing something or there's a bug here somewhere.

It's some custom code that I sadly can't put up publicly, but I've narrowed things down to a simple case I think, and it's a problem in existing code. If you do this, you'll reproduce it on master:
tox -e py27 keystone.tests.unit.test_catalog

If I run *all* the tests, the tests will pass fine. If you run just these tests, the problem exists.

This shows that:
 - there is a test isolation problem
 - these tests are relying on the actions of previous tests which do something that cause the policy file to be loaded.

I'm not familiar enough with the code to understand what's causing the policy file to get loaded early enough when running all the tests though.