bitcoin/test/functional/test_framework
fanquake 98b0acda0f
Merge bitcoin/bitcoin#28725: test: refactor: use built-in collection types for type hints (Python 3.9 / PEP 585)
a478c817b2 test: replace `Callable`/`Iterable` with their `collections.abc` alternative (PEP 585) (stickies-v)
4b9afb18e6 scripted-diff: use PEP 585 built-in collection types for verify-binary script (Sebastian Falbesoner)
d516cf83ed test: use built-in collection types for type hints (Python 3.9 / PEP 585) (Sebastian Falbesoner)

Pull request description:

  With Python 3.9 / [PEP 585](https://peps.python.org/pep-0585/), [type hinting has become a little less awkward](https://docs.python.org/3.9/whatsnew/3.9.html#type-hinting-generics-in-standard-collections), as for collection types one doesn't need to import the corresponding capitalized types (`Dict`, `List`, `Set`, `Tuple`, ...) anymore, but can use the built-in types directly (see  https://peps.python.org/pep-0585/#implementation for the full list).

  This PR applies the replacement for all Python scripts (i.e. in the contrib and test folders) for the basic types, i.e.:

  - typing.Dict -> dict
  - typing.List -> list
  - typing.Set  -> set
  - typing.Tuple -> tuple

  For an additional check, I ran mypy 1.6.1 on both master and the PR branch via
  ```
  $ mypy --ignore-missing-imports --explicit-package-bases $(git ls-files "*.py")
  ```
  and verified that the output is identical -- (from the 22 identified problems, most look like false-positives, it's probably worth it to go deeper here and address them in a follow-up though).

ACKs for top commit:
  stickies-v:
    ACK a478c817b2
  fanquake:
    ACK a478c817b2

Tree-SHA512: 6948c905f6abd644d84f09fcb3661d7edb2742e8f2b28560008697d251d77a61a1146ab4b070e65b0d27acede7a5256703da7bf6eb1c7c3a897755478c76c6e8
2023-11-17 11:19:17 +00:00
..
crypto [test/crypto] Add FSChaCha20Poly1305 AEAD python implementation 2023-09-29 17:50:38 +05:30
__init__.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
address.py refactor: move address_to_scriptpubkey to address.py 2023-03-28 16:54:28 +01:00
authproxy.py test: Rename EncodeDecimal to serialization_fallback 2023-06-29 19:51:43 +02:00
bdb.py scripted-diff: Bump copyright headers 2021-11-10 11:10:24 +01:00
bip340_test_vectors.csv tests: add BIP340 Schnorr signature support to test framework 2020-10-12 17:18:47 -07:00
blockfilter.py Merge bitcoin/bitcoin#28605: Fix typos 2023-11-16 10:35:49 +00:00
blocktools.py refactor: use address_to_scriptpubkey to retrieve addresses scriptpubkey 2023-03-28 16:58:16 +01:00
coverage.py test: fix PEP484 no implicit optional argument types errors 2023-06-29 16:14:07 -06:00
descriptors.py Output a descriptor in createmultisig and addmultisigaddress 2020-01-30 23:55:36 -05:00
key.py Merge bitcoin/bitcoin#28374: test: python cryptography required for BIP 324 functional tests 2023-11-07 16:48:57 -05:00
messages.py Merge bitcoin/bitcoin#28374: test: python cryptography required for BIP 324 functional tests 2023-11-07 16:48:57 -05:00
netutil.py test: add coverage to feature_addrman.py 2023-10-01 22:43:49 -05:00
p2p.py test: Add missing sync on send_version in peer_connect 2023-11-03 13:27:02 +01:00
psbt.py test: PSBT: eliminate magic numbers for global unsigned tx key (0) 2023-03-04 12:43:38 +01:00
script.py Merge bitcoin/bitcoin#28725: test: refactor: use built-in collection types for type hints (Python 3.9 / PEP 585) 2023-11-17 11:19:17 +00:00
script_util.py scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
segwit_addr.py Use Bech32m encoding for v1+ segwit addresses 2021-03-16 10:48:36 -07:00
socks5.py test: add keep_alive option to socks5 proxy in test_framework 2023-07-10 10:07:45 -04:00
test_framework.py Merge bitcoin/bitcoin#28725: test: refactor: use built-in collection types for type hints (Python 3.9 / PEP 585) 2023-11-17 11:19:17 +00:00
test_node.py test: Add missing wait for version to be sent in add_outbound_p2p_connection 2023-11-08 11:36:24 +01:00
test_shell.py scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
util.py Merge bitcoin/bitcoin#28725: test: refactor: use built-in collection types for type hints (Python 3.9 / PEP 585) 2023-11-17 11:19:17 +00:00
wallet.py test: use built-in collection types for type hints (Python 3.9 / PEP 585) 2023-10-25 01:10:21 +02:00
wallet_util.py test: Add Wallet Unlock Context Manager 2023-10-10 18:12:31 +03:00