Skip to content

Commit

Permalink
MS example test skip if no Redis
Browse files Browse the repository at this point in the history
  • Loading branch information
EltonCN committed Dec 4, 2024
1 parent df47552 commit 39428e9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/examples/test_memory_storage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import re

import redis
import unittest
from testbook import testbook
from testbook.client import TestbookNotebookClient

Expand All @@ -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):

Expand Down

0 comments on commit 39428e9

Please sign in to comment.