Skip to content
Snippets Groups Projects
Unverified Commit 9a7e0d2e authored by Erik Johnston's avatar Erik Johnston Committed by GitHub
Browse files

Don't require hiredis to run unit tests (#8680)

parent c97da1e4
No related branches found
No related tags found
No related merge requests found
Don't require `hiredis` package to be installed to run unit tests.
...@@ -16,7 +16,6 @@ import logging ...@@ -16,7 +16,6 @@ import logging
from typing import Any, Callable, List, Optional, Tuple from typing import Any, Callable, List, Optional, Tuple
import attr import attr
import hiredis
from twisted.internet.interfaces import IConsumer, IPullProducer, IReactorTime from twisted.internet.interfaces import IConsumer, IPullProducer, IReactorTime
from twisted.internet.protocol import Protocol from twisted.internet.protocol import Protocol
...@@ -39,12 +38,22 @@ from synapse.util import Clock ...@@ -39,12 +38,22 @@ from synapse.util import Clock
from tests import unittest from tests import unittest
from tests.server import FakeTransport, render from tests.server import FakeTransport, render
try:
import hiredis
except ImportError:
hiredis = None
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class BaseStreamTestCase(unittest.HomeserverTestCase): class BaseStreamTestCase(unittest.HomeserverTestCase):
"""Base class for tests of the replication streams""" """Base class for tests of the replication streams"""
# hiredis is an optional dependency so we don't want to require it for running
# the tests.
if not hiredis:
skip = "Requires hiredis"
servlets = [ servlets = [
streams.register_servlets, streams.register_servlets,
] ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment