diff options
author | Erik Johnston <erik@matrix.org> | 2020-10-29 11:17:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-29 11:17:35 +0000 |
commit | 9a7e0d2ea675278510b79fd9b87260c13cc27a32 (patch) | |
tree | a19879866ac09a8469fe7c57e3e93d9eb4dfebd7 /tests/replication | |
parent | Merge pull request #8678 from matrix-org/rav/fix_frozen_events (diff) | |
download | synapse-9a7e0d2ea675278510b79fd9b87260c13cc27a32.tar.xz |
Don't require hiredis to run unit tests (#8680)
Diffstat (limited to 'tests/replication')
-rw-r--r-- | tests/replication/_base.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/replication/_base.py b/tests/replication/_base.py index f1e53f33cd..5c633ac6df 100644 --- a/tests/replication/_base.py +++ b/tests/replication/_base.py @@ -16,7 +16,6 @@ import logging from typing import Any, Callable, List, Optional, Tuple import attr -import hiredis from twisted.internet.interfaces import IConsumer, IPullProducer, IReactorTime from twisted.internet.protocol import Protocol @@ -39,12 +38,22 @@ from synapse.util import Clock from tests import unittest from tests.server import FakeTransport, render +try: + import hiredis +except ImportError: + hiredis = None + logger = logging.getLogger(__name__) class BaseStreamTestCase(unittest.HomeserverTestCase): """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 = [ streams.register_servlets, ] |