From 5b39860a414e5a6fe2a2b9293fc78f844e7e73db Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Wed, 5 Jun 2019 08:59:30 +0200 Subject: [PATCH] #4460 Improved error messages for pytest --- ApplicationCode/GrpcInterface/Python/rips/Instance.py | 3 ++- ApplicationCode/GrpcInterface/Python/tests/conftest.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/GrpcInterface/Python/rips/Instance.py b/ApplicationCode/GrpcInterface/Python/rips/Instance.py index c69d154215..81a31ed5c2 100644 --- a/ApplicationCode/GrpcInterface/Python/rips/Instance.py +++ b/ApplicationCode/GrpcInterface/Python/rips/Instance.py @@ -29,7 +29,8 @@ class Instance: if not resInsightExecutable: resInsightExecutable = os.environ.get('RESINSIGHT_EXECUTABLE') if not resInsightExecutable: - print('Error: Could not launch any ResInsight instances because RESINSIGHT_EXECUTABLE is not set') + print('ERROR: Could not launch ResInsight because the environment variable' + ' RESINSIGHT_EXECUTABLE is not set') return None while Instance.is_port_in_use(port): diff --git a/ApplicationCode/GrpcInterface/Python/tests/conftest.py b/ApplicationCode/GrpcInterface/Python/tests/conftest.py index 7856c359f3..ac4297201a 100644 --- a/ApplicationCode/GrpcInterface/Python/tests/conftest.py +++ b/ApplicationCode/GrpcInterface/Python/tests/conftest.py @@ -8,6 +8,7 @@ import rips instance = rips.Instance.launch() if (not instance): + print("A ResInsight instance is required for running the tests") exit(1) @pytest.fixture