Don't use patcher.start(), specially if patcher.stop() is not called it breaks unrelated tests.

Refs 7a59410c2d

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-01-07 20:01:22 +00:00 committed by Pedro Algarvio
parent 6a09056c72
commit c753051359

View file

@ -11,9 +11,8 @@ from tests.support.mock import MagicMock, patch
@pytest.fixture
def configure_loader_modules():
patcher = patch("salt.utils.path.which", lambda exe: exe)
patcher.start()
return {djangomod: {}}
with patch("salt.utils.path.which", lambda exe: exe):
yield {djangomod: {}}
def test_command():