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

Commit

Permalink
Only import MemoryReactor if type-checking in test_scheduler; fix old…
Browse files Browse the repository at this point in the history
…-deps
  • Loading branch information
anoadragon453 committed Jan 26, 2022
1 parent 8129657 commit de48ab4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/appservice/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING
from unittest.mock import Mock

from twisted.internet import defer
from twisted.internet.testing import MemoryReactor

from synapse.appservice import ApplicationServiceState
from synapse.appservice.scheduler import (
Expand All @@ -31,6 +31,9 @@

from ..utils import MockClock

if TYPE_CHECKING:
from twisted.internet.testing import MemoryReactor


class ApplicationServiceSchedulerTransactionCtrlTestCase(unittest.TestCase):
def setUp(self):
Expand Down Expand Up @@ -199,7 +202,7 @@ def take_txn(*args, **kwargs):


class ApplicationServiceSchedulerQueuerTestCase(unittest.HomeserverTestCase):
def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer):
def prepare(self, reactor: "MemoryReactor", clock: Clock, hs: HomeServer):
self.scheduler = ApplicationServiceScheduler(hs)
self.txn_ctrl = Mock()
self.txn_ctrl.send = simple_async_mock()
Expand Down

0 comments on commit de48ab4

Please sign in to comment.