Revert "Make fixtures clean up even if the test fails"

This reverts commit 176fe04e8d.
This commit is contained in:
Pedro Algarvio 2024-04-03 09:02:49 +01:00
parent ecb537efef
commit 1a8ea6b343
2 changed files with 7 additions and 13 deletions

View file

@ -3,7 +3,7 @@ import pytest
from salt.exceptions import CommandExecutionError
pytestmark = [
pytest.mark.destructive_test,
pytest.mark.destructive,
pytest.mark.skip_unless_on_windows,
pytest.mark.slow_test,
pytest.mark.windows_whitelisted,
@ -23,10 +23,8 @@ def clean(chocolatey):
except CommandExecutionError:
chocolatey_version = None
assert chocolatey_version is None
try:
yield
finally:
chocolatey.unbootstrap()
yield
chocolatey.unbootstrap()
def test_bootstrap(chocolatey, clean):

View file

@ -28,10 +28,8 @@ def clean(chocolatey_mod):
except CommandExecutionError:
chocolatey_version = None
assert chocolatey_version is None
try:
yield
finally:
chocolatey_mod.unbootstrap()
yield
chocolatey_mod.unbootstrap()
@pytest.fixture()
@ -42,10 +40,8 @@ def installed(chocolatey_mod):
except CommandExecutionError:
chocolatey_version = None
assert chocolatey_version is not None
try:
yield
finally:
chocolatey_mod.unbootstrap()
yield
chocolatey_mod.unbootstrap()
def test_bootstrapped(chocolatey, chocolatey_mod, clean):