mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Don't require hiredis to run unit tests (#8680)
This commit is contained in:
parent
c97da1e45d
commit
9a7e0d2ea6
1
changelog.d/8680.misc
Normal file
1
changelog.d/8680.misc
Normal file
@ -0,0 +1 @@
|
||||
Don't require `hiredis` package to be installed to run unit tests.
|
@ -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,
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user