dash/test/functional/test_framework
MarcoFalke ec4cbc28d6
Merge #20954: test: Declare nodes type in test_framework.py.
5353b0c64d32e44fc411464e080d4b00fae7124e Change type definitions for "chain" and "setup_clean_chain" from type comments to Python 3.6+ types. Additionally, set type for "nodes". (Kiminuo)

Pull request description:

  ### Motivation

  When I wanted to understand better https://github.com/bitcoin/bitcoin/pull/19145/files#diff-4bebbd3b112dc222ea7e75ef051838ceffcee63b9e9234a98a4cc7251d34451b test, I noticed that navigation in PyCharm/VS Code did not work for `nodes` variable. I think this is frustrating, especially for newcomers.

  ### Summary

  * This PR modifies Python 3.5 [type comments](https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html#variables) to Python 3.6+ types and adds a proper type for `nodes` [instance attribute](https://mypy.readthedocs.io/en/stable/class_basics.html#instance-and-class-attributes).
  * This PR does not change behavior.
  * This PR is intentionally very small, if the concept is accepted, a follow-up PRs can be more ambitious.

  ### End result

  1. Open `test/functional/feature_abortnode.py`
  2. Move your caret to: `self.nodes[0].generate[caret here](3)`
  3. Use "Go to definition" [F12] should work now.

  I have tested this on PyCharm (Windows, Ubuntu) and VS Code (Windows, Ubuntu).

  Note: Some `TestNode` methods (e.g. `self.nodes[0].getblock(...)` ) use `__call__` mechanism and navigation does not work for them even with this PR.

ACKs for top commit:
  laanwj:
    ACK 5353b0c64d32e44fc411464e080d4b00fae7124e
  theStack:
    ACK 5353b0c64d32e44fc411464e080d4b00fae7124e

Tree-SHA512: 821773f052ab9b2889dc357d38c59407a4af09e3b86d7134fcca7d78e5edf3a5ede9bfb37595ea97caf9ebfcbda372bcf73763b7f89b0677670f21b3e396a12b
2023-12-03 20:44:55 -06:00
..
__init__.py
address.py Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
authproxy.py merge bitcoin#19762: Allow named and positional arguments to be used together 2023-07-28 00:18:27 -05:00
blocktools.py fix: some fixes for block payee validation and corresponding tests (#5684) 2023-11-13 10:02:52 -06:00
coverage.py Merge bitcoin/bitcoin#22139: test: add type annotations to util.get_rpc_proxy 2023-12-03 20:13:09 -06:00
descriptors.py
key.py
messages.py Merge #18610: scripted-diff: test: replace command with msgtype (naming) 2023-12-03 20:01:26 -06:00
mininode.py Merge #18610: scripted-diff: test: replace command with msgtype (naming) 2023-12-03 20:01:26 -06:00
muhash.py
netutil.py
ripemd160.py
script_util.py
script.py Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
siphash.py
socks5.py
test_framework.py Merge #20954: test: Declare nodes type in test_framework.py. 2023-12-03 20:44:55 -06:00
test_node.py Merge bitcoin/bitcoin#22139: test: add type annotations to util.get_rpc_proxy 2023-12-03 20:13:09 -06:00
test_shell.py
util.py Merge bitcoin/bitcoin#22139: test: add type annotations to util.get_rpc_proxy 2023-12-03 20:13:09 -06:00
wallet_util.py