Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

import os
import re

from ansys.tools.versioning import server_meets_version
Expand All @@ -34,6 +35,8 @@

SKIP_ON_VERSIONS = ["22.2", "23.1", "23.2", "24.1", "24.2", "25.1", "25.2"]

TEST_DB = os.getenv("TEST_DB", "false").lower() == "true"


@pytest.fixture(scope="session")
def db(mapdl):
Expand Down Expand Up @@ -62,6 +65,9 @@ def db(mapdl):
f"This version of MAPDL gRPC API version ('ansys.api.mapdl' == {ver_}) is not compatible with 'database' module."
)

if not TEST_DB:
pytest.skip("Database tests are skipped")

mapdl.clear()
if mapdl.db.active or mapdl.db._stub is None:
mapdl.db.stop()
Expand Down Expand Up @@ -94,6 +100,9 @@ def test_database_start_stop(mapdl, cleared):
f"This MAPDL version ({mapdl_version}) docker image seems to not support DB, but local does."
)

if not TEST_DB:
pytest.skip("Database tests are skipped")

if MapdlDb(mapdl).active:
MapdlDb(mapdl)._stop()

Expand Down
Loading