summaryrefslogtreecommitdiff
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-09-21 10:08:05 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-09-21 10:08:05 -0400
commit0817978fcd67bc8e84369d163aff55c1a614b711 (patch)
treebf429e51da76aaae43f61d54d5eabb4c2fc5c9c9 /tests/conftest.py
parentb89e0b369a0d11a78503ead276da28059c54db45 (diff)
downloadcmd2-git-0817978fcd67bc8e84369d163aff55c1a614b711.tar.gz
Removed remaining type hints in docstrings
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index a23c44d0..a85135b9 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -6,9 +6,10 @@ Copyright 2016 Federico Ceratto <federico.ceratto@gmail.com>
Released under MIT license, see LICENSE file
"""
import sys
+from typing import Optional
+from unittest import mock
from pytest import fixture
-from unittest import mock
import cmd2
@@ -156,17 +157,17 @@ def base_app():
return c
-def complete_tester(text, line, begidx, endidx, app):
+def complete_tester(text: str, line: str, begidx: int, endidx: int, app) -> Optional[str]:
"""
This is a convenience function to test cmd2.complete() since
in a unit test environment there is no actual console readline
is monitoring. Therefore we use mock to provide readline data
to complete().
- :param text: str - the string prefix we are attempting to match
- :param line: str - the current input line with leading whitespace removed
- :param begidx: int - the beginning index of the prefix text
- :param endidx: int - the ending index of the prefix text
+ :param text: the string prefix we are attempting to match
+ :param line: the current input line with leading whitespace removed
+ :param begidx: the beginning index of the prefix text
+ :param endidx: the ending index of the prefix text
:param app: the cmd2 app that will run completions
:return: The first matched string or None if there are no matches
Matches are stored in app.completion_matches