script, test: add missing python type annotations

Fix warnings for these files when ./test/lint/lint-python.py is run using
mypy 0.991 (released 11/2022) and later:

"By default the bodies of untyped functions are not checked, consider using
--check-untyped-defs [annotation-unchecked]"

For details, see:

https://mypy-lang.blogspot.com/2022/11/mypy-0990-released.html
pull/28009/head
Jon Atack 1 year ago
parent c6287faae4
commit f86a301433

@ -28,7 +28,7 @@ def clean_files(source, executable):
os.remove(source) os.remove(source)
os.remove(executable) os.remove(executable)
def call_security_check(cc, source, executable, options): def call_security_check(cc: str, source: str, executable: str, options) -> tuple:
# This should behave the same as AC_TRY_LINK, so arrange well-known flags # This should behave the same as AC_TRY_LINK, so arrange well-known flags
# in the same order as autoconf would. # in the same order as autoconf would.
# #

@ -19,7 +19,7 @@ TIME_SIZE = 8
LENGTH_SIZE = 4 LENGTH_SIZE = 4
MSGTYPE_SIZE = 12 MSGTYPE_SIZE = 12
def mini_parser(dat_file): def mini_parser(dat_file: str) -> None:
"""Parse a data file created by CaptureMessageToFile. """Parse a data file created by CaptureMessageToFile.
From the data file we'll only check the structure. From the data file we'll only check the structure.

@ -92,7 +92,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
This class also contains various public and private helper methods.""" This class also contains various public and private helper methods."""
def __init__(self): def __init__(self) -> None:
"""Sets test framework defaults. Do not override this method. Instead, override the set_test_params() method""" """Sets test framework defaults. Do not override this method. Instead, override the set_test_params() method"""
self.chain: str = 'regtest' self.chain: str = 'regtest'
self.setup_clean_chain: bool = False self.setup_clean_chain: bool = False

Loading…
Cancel
Save