From 288e8d78d3e2da2aa58406b4e0ad9db786a335f6 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Wed, 18 Dec 2024 16:59:42 -0500 Subject: Cleanup in-memory data from test that randomly causes other failures (#15716) --- awx/main/tests/functional/test_inventory_source_migration.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/awx/main/tests/functional/test_inventory_source_migration.py b/awx/main/tests/functional/test_inventory_source_migration.py index 812b4b45b9..fe0b537426 100644 --- a/awx/main/tests/functional/test_inventory_source_migration.py +++ b/awx/main/tests/functional/test_inventory_source_migration.py @@ -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', -- cgit v1.2.3