Page MenuHomePhabricator

test: use f-strings in p2p_* tests
ClosedPublic

Authored by PiRK on Feb 28 2023, 16:08.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCdb2b26d839c6: test: use f-strings in p2p_* tests
Summary

scripted diff

flynt --transform-concats test/functional/p2p_*

Manual changes:

  • remove the + operator in a string concatenation so that flynt --transform-concats does not touch it (and therefore does not remove useful comments)
  • remove unecessary string formatting when converting blockhashes to int

Depends on D13195

Test Plan

test/functional/test_runner.py p2p_*

Event Timeline

PiRK requested review of this revision.Feb 28 2023, 16:08
Fabien requested changes to this revision.Feb 28 2023, 16:37
Fabien added a subscriber: Fabien.
Fabien added inline comments.
test/functional/p2p_invalid_messages.py
202

Please keep the comments, they are useful (but you can keep the f string)

test/functional/p2p_unrequested_blocks.py
91

use a formatter instead

112

dito

This revision now requires changes to proceed.Feb 28 2023, 16:37
PiRK edited the summary of this revision. (Show Details)

Don't use + operator in string concat so that flynt --transform-concats does not touch if and does not remove useful comments.
I don't know if future versions of flynt will keep this behavior. If it changes, we can find another solution.

Remove unecessary string conversion when converting hex string (block hash) to int.

This revision is now accepted and ready to land.Mar 1 2023, 08:56
This revision was automatically updated to reflect the committed changes.