Comment 4 for bug 1428728

Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

This is due to nova/tests/unit/api/openstack/compute/contrib/test_services.py:FakeRequest

It calls context.get_admin_context() as part of the construction of the class, which implicitly creates a context, which then gets registered.

The fix here is to either clear any contexts out before tests run, or to make FakeRequest (and there are some others) call get_admin_context() during __init__() instead.