diff --git a/okonomiyaki/runtimes/tests/test_runtime.py b/okonomiyaki/runtimes/tests/test_runtime.py index 5af6355..6912172 100644 --- a/okonomiyaki/runtimes/tests/test_runtime.py +++ b/okonomiyaki/runtimes/tests/test_runtime.py @@ -1,9 +1,10 @@ -import os.path import sys +import os.path import unittest from okonomiyaki.platforms import EPDPlatform from okonomiyaki.versions import RuntimeVersion +from okonomiyaki.utils.testing import known_system from ..runtime import PythonRuntime @@ -13,6 +14,10 @@ class TestPythonRuntime(unittest.TestCase): + + @unittest.skipIf( + not known_system, + 'This test should be executed only on Enthought supported platforms') def test_simple_from_running_python(self): # When runtime_info = PythonRuntime.from_running_python() diff --git a/okonomiyaki/utils/testing.py b/okonomiyaki/utils/testing.py index 0c3170f..346ae7c 100644 --- a/okonomiyaki/utils/testing.py +++ b/okonomiyaki/utils/testing.py @@ -1,3 +1,6 @@ +from okonomiyaki.errors import OkonomiyakiError + + class Patcher(object): """ A dumb class to allow a mock.patch object to be used as a decorator and a context manager @@ -48,3 +51,16 @@ def __enter__(self): def __exit__(self, *a, **kw): for patcher in self._patchers: patcher.__exit__(*a, **kw) + + +def known_system(self): + from okonomiyaki.plarforms._platform import ( + _guess_os_kind, _guess_platform, _guess_platform_details) + try: + os_kind = _guess_os_kind() + _guess_platform(os_kind) + _guess_platform_details(os_kind) + except OkonomiyakiError: + return False + else: + return True