summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Rominger <arominge@redhat.com>2024-12-18 22:59:42 +0100
committerGitHub <noreply@github.com>2024-12-18 22:59:42 +0100
commit288e8d78d3e2da2aa58406b4e0ad9db786a335f6 (patch)
tree016fc886b7e05f33363f7542f87ebef6847f5d34
parentFix test warnings that escaped somehow (#15714) (diff)
downloadawx-288e8d78d3e2da2aa58406b4e0ad9db786a335f6.tar.xz
awx-288e8d78d3e2da2aa58406b4e0ad9db786a335f6.zip
Cleanup in-memory data from test that randomly causes other failures (#15716)
-rw-r--r--awx/main/tests/functional/test_inventory_source_migration.py9
1 files changed, 8 insertions, 1 deletions
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',