Skip to content

Commit

Permalink
Ensure correct finalizer order
Browse files Browse the repository at this point in the history
the host was not deleted before the hostgroup

see: pytest-dev/pytest#10023 (comment)
  • Loading branch information
dosas committed Apr 4, 2024
1 parent 9fc762a commit cb296b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/foreman/api/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def test_positive_parameter_precedence_impact(
cp = module_target_sat.api.CommonParameter(name=param_name, value=param_value).create()
request.addfinalizer(cp.delete)
host = module_target_sat.api.Host(organization=module_org, location=module_location).create()
request.addfinalizer(host.delete)
result = [res for res in host.all_parameters if res['name'] == param_name]
assert result[0]['name'] == param_name
assert result[0]['associated_type'] == 'global'
Expand All @@ -51,6 +50,7 @@ def test_positive_parameter_precedence_impact(
group_parameters_attributes=[{'name': param_name, 'value': param_value}],
).create()
request.addfinalizer(hg.delete)
request.addfinalizer(host.delete)
host.hostgroup = hg
host = host.update(['hostgroup'])
result = [res for res in host.all_parameters if res['name'] == param_name]
Expand Down

0 comments on commit cb296b3

Please sign in to comment.