From fa18913b8bc397c89a38220e10bfbbaa67be33ed Mon Sep 17 00:00:00 2001 From: Greg Price Date: Tue, 15 May 2018 14:26:06 -0400 Subject: [PATCH] test_helpers: Fix a nonexistent import. This module doesn't exist, and never did; the name appears to be a mistaken variant of the module that really does contain ZulipTestCase. So, fix the import to use the real name. This would never have worked at runtime, which is why it's in an `if False:`. It's also an example of the kind of error that can be hidden by `ignore_missing_imports`; we'd have caught the issue immediately if we hadn't had a blanket application of that flag in place. --- mypy.ini | 3 --- zerver/lib/test_helpers.py | 6 ++---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/mypy.ini b/mypy.ini index d8ec951ff0..b708fa621c 100644 --- a/mypy.ini +++ b/mypy.ini @@ -36,9 +36,6 @@ ignore_missing_imports = True [mypy-lister,.lister] ignore_missing_imports = True -[mypy-zerver.lib.test_case] -ignore_missing_imports = True - # Zulip code from elsewhere diff --git a/zerver/lib/test_helpers.py b/zerver/lib/test_helpers.py index 4da877b352..db81044dec 100644 --- a/zerver/lib/test_helpers.py +++ b/zerver/lib/test_helpers.py @@ -46,9 +46,7 @@ from zerver.models import ( ) from zerver.lib.request import JsonableError - -if False: - from zerver.lib.test_case import ZulipTestCase +from zerver.lib.test_classes import ZulipTestCase import collections import base64 @@ -291,7 +289,7 @@ def instrument_url(f: UrlFuncT) -> UrlFuncT: if not INSTRUMENTING: # nocoverage -- option is always enabled; should we remove? return f else: - def wrapper(self: 'ZulipTestCase', url: str, info: Dict[str, Any]={}, + def wrapper(self: ZulipTestCase, url: str, info: Dict[str, Any]={}, **kwargs: Any) -> HttpResponse: start = time.time() result = f(self, url, info, **kwargs)