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.
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.