Page MenuHomePhabricator

test: remove unused constants in functional tests
ClosedPublic

Authored by PiRK on Oct 14 2021, 14:41.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC1b8e36663d9e: test: remove unused constants in functional tests
Summary

This mini-PR gets rid of constants in functional tests that are not used anymore. Found by vulture via the following script that has been lying around here locally for quite some time (I think it was once proposed by practicalswift, but I don't remember the concrete topic/PR):

#!/bin/sh
for F in $(git ls-files -- "*.py"); do vulture "$F" | grep "unused variable"; done

I used the script to look for more unused variables and remove them. But note that it show mostly false positives (most likely because the test framework is not using "standard" python coding practices), so it is not a reliable way of finding unused variables.

I left some unused variables that will be removed by upcoming backports.

I also left a couple of unused variables that seem to document missing test coverage:

  • BLOCKSIZE_TOO_LOW in abc_rpc_excessiveblock.py is an CLI error message that cannot be triggered via RPC
  • RPC_FORK_PRIOR_FINALIZED_ERROR in abc-finalize-block.py is an error message that still exists in validation.cpp but is not tested

The constant removed in abc-schnormultisig.py is just an unused copy-pasta from abc-schnorr.py

This is a backport of core#20023

Test Plan

ninja check-functional-extended

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Oct 14 2021, 14:41
PiRK planned changes to this revision.Oct 14 2021, 14:43

this should only do constants, not loop variables

PiRK edited the summary of this revision. (Show Details)

move the loop counter changes to D10345

This revision is now accepted and ready to land.Oct 14 2021, 15:18