Cleanup in-memory data from test that randomly causes other failures (#15716)

This commit is contained in:
Alan Rominger 2024-12-18 16:59:42 -05:00 committed by GitHub
parent c0158181c3
commit 288e8d78d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,8 +31,15 @@ def test_apply_new_instance_id(inventory_source):
assert host2.instance_id == 'bad_user'
def cleanup_cloudforms():
if 'cloudforms' in ManagedCredentialType.registry:
del ManagedCredentialType.registry['cloudforms']
assert 'cloudforms' not in CredentialType.defaults
@pytest.mark.django_db
def test_cloudforms_inventory_removal(inventory):
def test_cloudforms_inventory_removal(request, inventory):
request.addfinalizer(cleanup_cloudforms)
ManagedCredentialType(
name='Red Hat CloudForms',
namespace='cloudforms',