diff --git a/tests/examples/test_memory_storage.py b/tests/examples/test_memory_storage.py index 9aea827..9bb19cb 100644 --- a/tests/examples/test_memory_storage.py +++ b/tests/examples/test_memory_storage.py @@ -1,6 +1,8 @@ import os import re +import redis +import unittest from testbook import testbook from testbook.client import TestbookNotebookClient @@ -10,9 +12,16 @@ examples_path = get_examples_path() else: - examples_path = "examples" +client = redis.Redis(decode_responses=True) +try: + client.ping() + redis_reachable = True +except Exception: + redis_reachable = False + +@unittest.skipIf(not redis_reachable, "Redis server not running") @testbook(os.path.join(examples_path, "Memory Storage.ipynb"), execute=True) def test_gym_integration(tb :TestbookNotebookClient):