From 6f566d72cc75d11ffd9b45d275059c1770fafaf3 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Wed, 31 Jul 2024 13:47:06 +0200 Subject: [PATCH] fix: skip tests if not on remote --- tests/conftest.py | 8 ++++++++ tests/test_grpc.py | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index c91df8b2a7..8cfaa8095c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -87,6 +87,11 @@ reason="Skipping because not on local. ", ) +skip_if_not_remote = pytest.mark.skipif( + ON_LOCAL, + reason="Skipping because not on remote. ", +) + skip_if_on_cicd = pytest.mark.skipif( ON_CI, reason="""Skip if on CI/CD.""", @@ -146,6 +151,9 @@ def requires(requirement: str): elif "local" == requirement: return skip_if_not_local + elif "remote" == requirement: + return skip_if_not_remote + elif "cicd" == requirement: return skip_if_on_cicd diff --git a/tests/test_grpc.py b/tests/test_grpc.py index 0bc7cd32bb..a9916d8695 100644 --- a/tests/test_grpc.py +++ b/tests/test_grpc.py @@ -578,7 +578,9 @@ def test__check_stds(mapdl): assert mapdl._stderr is not None -def test_exception_message_length(monkeypatch, mapdl): +@requires("remote") +def test_exception_message_length(mapdl): + # This test does not fail if running on local channel = grpc.insecure_channel( mapdl._channel_str, options=[