From 197586230a52209847a3d5b9f8bb4631be8480f7 Mon Sep 17 00:00:00 2001 From: Bo Maryniuk Date: Tue, 30 Jan 2018 17:03:58 +0100 Subject: [PATCH] Skip tests if there is no pytest installed --- tests/unit/modules/test_localemod.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/unit/modules/test_localemod.py b/tests/unit/modules/test_localemod.py index c8a764e2cd..f6b4ea5704 100644 --- a/tests/unit/modules/test_localemod.py +++ b/tests/unit/modules/test_localemod.py @@ -16,12 +16,17 @@ from tests.support.mock import ( NO_MOCK, NO_MOCK_REASON ) +try: + import pytest +except ImportError as import_error: + pytest = None # Import Salt Libs import salt.modules.localemod as localemod from salt.exceptions import CommandExecutionError +@skipIf(not pytest, False) @skipIf(NO_MOCK, NO_MOCK_REASON) class LocalemodTestCase(TestCase, LoaderModuleMockMixin): '''