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

Commit

Permalink
Don't require hiredis to run unit tests (#8680)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Oct 29, 2020
1 parent c97da1e commit 9a7e0d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
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

0 comments on commit 9a7e0d2

Please sign in to comment.