Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

test_narrow: Fix strict_optional errors.

Anders Kaseorgdd7082e466bb
diff --git a/mypy.ini b/mypy.ini
index b925f2e319c..5c1e2868969 100644
--- a/mypy.ini
+++ b/mypy.ini
@@ -40,8 +40,6 @@ strict_optional = True
# Tests (may be many issues in file; comment is just one error noted)
-[mypy-zerver/tests/test_narrow] #515: error: Incompatible types in assignment (expression has type "None", variable has type "int")
-strict_optional = False
[mypy-zerver/tests/test_logging_handlers] #73: error: Argument 7 to "makeRecord" of "Logger" has incompatible type "Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]"; expected "Union[Tuple[type, BaseException, TracebackType], Tuple[None, None, None], None]"
strict_optional = False
[mypy-zerver/tests/test_decorators] #1322: error: Item "None" of "Optional[Match[str]]" has no attribute "groupdict"
diff --git a/zerver/tests/test_narrow.py b/zerver/tests/test_narrow.py
index a3b68073299..e90c2ec50bd 100644
--- a/zerver/tests/test_narrow.py
+++ b/zerver/tests/test_narrow.py
@@ -863,7 +863,7 @@ class PostProcessTest(ZulipTestCase):
)
# left-sided query anchored to the right
- anchor = None
+ anchor = LARGER_THAN_MAX_MESSAGE_ID
verify(
in_ids=[900, 1000],
num_before=2, num_after=0,