aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/coverage.py
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2023-06-29 15:18:49 -0600
committerJon Atack <jon@atack.com>2023-06-29 16:14:07 -0600
commit92408224a4cb2f454465d5ff8445c247f2c4318a (patch)
tree54cdcc5652d4bca09c8a34da23f5ba39b898d7e2 /test/functional/test_framework/coverage.py
parentf86a3014338de6a2204bbdda10795b75ef6654c0 (diff)
test: fix PEP484 no implicit optional argument types errors
Fix warnings for these files when ./test/lint/lint-python.py is run using mypy 0.991 (released 11/2022) and later: $ test/lint/lint-python.py test/functional/test_framework/coverage.py:23: error: Incompatible default for argument "coverage_logfile" (default has type "None", argument has type "str") [assignment] test/functional/test_framework/coverage.py:23: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True test/functional/test_framework/util.py:318: error: Incompatible default for argument "timeout" (default has type "None", argument has type "int") [assignment] test/functional/test_framework/util.py:318: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True test/functional/test_framework/util.py:318: error: Incompatible default for argument "coveragedir" (default has type "None", argument has type "str") [assignment] test/functional/interface_rest.py:67: error: Incompatible default for argument "query_params" (default has type "None", argument has type "dict[str, Any]") [assignment] test/functional/interface_rest.py:67: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True Verified using https://github.com/hauntsaninja/no_implicit_optional For details, see: https://mypy-lang.blogspot.com/2022/11/mypy-0990-released.html
Diffstat (limited to 'test/functional/test_framework/coverage.py')
-rw-r--r--test/functional/test_framework/coverage.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/functional/test_framework/coverage.py b/test/functional/test_framework/coverage.py
index 4fb4f8bb82..912a945d95 100644
--- a/test/functional/test_framework/coverage.py
+++ b/test/functional/test_framework/coverage.py
@@ -11,6 +11,7 @@ testing.
import os
from .authproxy import AuthServiceProxy
+from typing import Optional
REFERENCE_FILENAME = 'rpc_interface.txt'
@@ -20,7 +21,7 @@ class AuthServiceProxyWrapper():
An object that wraps AuthServiceProxy to record specific RPC calls.
"""
- def __init__(self, auth_service_proxy_instance: AuthServiceProxy, rpc_url: str, coverage_logfile: str=None):
+ def __init__(self, auth_service_proxy_instance: AuthServiceProxy, rpc_url: str, coverage_logfile: Optional[str]=None):
"""
Kwargs:
auth_service_proxy_instance: the instance being wrapped.