Travis reports a false positive on master at the moment:
test/functional/data/invalid_txs.py:217: unused variable 'DisabledOpcodeTemplates' (60% confidence)
^---- failure generated from test/lint/lint-python-dead-code.sh
I have to agree with the linter that it's slightly confusing code, as DisabledOpcodeTemplates (introduced in 0c62e3aa73839e97e65a3155e06a98d84b700a1e, #14696) is not used directly, but the objects created here are definitely used in iter_all_templates by iterating over the subclasses.
e.g.
…
$ test/functional/p2p_invalid_tx.py
2019-09-18T15:28:40.922000Z TestFramework (INFO): Testing invalid transaction: DisabledOpcode_OP_CAT
2019-09-18T15:28:41.026000Z TestFramework (INFO): Reconnecting to peer
2019-09-18T15:28:41.078000Z TestFramework (INFO): Testing invalid transaction: DisabledOpcode_OP_SUBSTR
2019-09-18T15:28:41.182000Z TestFramework (INFO): Reconnecting to peer
2019-09-18T15:28:41.233000Z TestFramework (INFO): Testing invalid transaction: DisabledOpcode_OP_LEFT
2019-09-18T15:28:41.338000Z TestFramework (INFO): Reconnecting to peer
2019-09-18T15:28:41.389000Z TestFramework (INFO): Testing invalid transaction: DisabledOpcode_OP_RIGHT
2019-09-18T15:28:41.494000Z TestFramework (INFO): Reconnecting to peer
2019-09-18T15:28:41.545000Z TestFramework (INFO): Testing invalid transaction: DisabledOpcode_OP_INVERT
2019-09-18T15:28:41.649000Z TestFramework (INFO): Reconnecting to peer
2019-09-18T15:28:41.701000Z TestFramework (INFO): Testing invalid transaction: DisabledOpcode_OP_AND
2019-09-18T15:28:41.805000Z TestFramework (INFO): Reconnecting to peer
2019-09-18T15:28:41.856000Z TestFramework (INFO): Testing invalid transaction: DisabledOpcode_OP_OR
2019-09-18T15:28:41.960000Z TestFramework (INFO): Reconnecting to peer
2019-09-18T15:28:42.012000Z TestFramework (INFO): Testing invalid transaction: DisabledOpcode_OP_XOR
2019-09-18T15:28:42.116000Z TestFramework (INFO): Reconnecting to peer
2019-09-18T15:28:42.167000Z TestFramework (INFO): Testing invalid transaction: DisabledOpcode_OP_2MUL
2019-09-18T15:28:42.271000Z TestFramework (INFO): Reconnecting to peer
2019-09-18T15:28:42.322000Z TestFramework (INFO): Testing invalid transaction: DisabledOpcode_OP_2DIV
2019-09-18T15:28:42.427000Z TestFramework (INFO): Reconnecting to peer
2019-09-18T15:28:42.479000Z TestFramework (INFO): Testing invalid transaction: DisabledOpcode_OP_MUL
2019-09-18T15:28:42.583000Z TestFramework (INFO): Reconnecting to peer
…