Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Don't require hiredis to run unit tests #8680

Merged
merged 3 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8680.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't require `hiredis` package to be installed to run unit tests.
11 changes: 10 additions & 1 deletion tests/replication/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
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
Expand All @@ -39,12 +38,22 @@
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,
]
Expand Down