Remove unused testing code.
Rationale:
- Less is more :-)
- Unused code is by definition “untested”
- YAGNI
Remove unused testing code.
Rationale:
514@@ -515,18 +515,6 @@ def skip_if_no_wallet(self):
515         if not self.is_wallet_compiled():
516             raise SkipTest("wallet has not been compiled.")
517 
518-    def skip_if_no_cli(self):
Should probably call this:
 0diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py
 1index 9a589240a8..238b50387d 100755
 2--- a/test/functional/test_framework/test_framework.py
 3+++ b/test/functional/test_framework/test_framework.py
 4@@ -161,8 +161,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
 5         success = TestStatus.FAILED
 6 
 7         try:
 8-            if self.options.usecli and not self.supports_cli:
 9-                raise SkipTest("--usecli specified but test does not support using CLI")
10+            if self.options.usecli:
11+                if not self.supports_cli:
12+                    raise SkipTest("--usecli specified but test does not support using CLI")
13+                self.skip_if_no_cli()
14             self.skip_test_if_missing_module()
15             self.setup_chain()
16             self.setup_network()
312@@ -313,7 +313,7 @@ def on_ping(self, message):
313         self.send_message(msg_pong(message.nonce))
314 
315     def on_verack(self, message):
316-        self.verack_received = True
317+        pass
1079-
1080-    def serialize(self):
1081-        return self.data
1082-
1083-    def __repr__(self):
1084-        return "msg_generic()"
53@@ -54,9 +54,6 @@
54 def sha256(s):
55     return hashlib.new('sha256', s).digest()
56 
57-def ripemd160(s):
58-    return hashlib.new('ripemd160', s).digest()
24@@ -25,7 +25,7 @@
25 
26 # Reject codes that we might receive in this test
27 REJECT_INVALID = 16
28-REJECT_OBSOLETE = 17
29+# REJECT_OBSOLETE = 17
30@@ -31,7 +31,7 @@
31 MY_SUBVERSION = b"/python-mininode-tester:0.0.3/"
32 MY_RELAY = 1 # from version 70001 onwards, fRelay should be appended to version messages (BIP37)
33 
34-MAX_INV_SZ = 50000
35+# MAX_INV_SZ = 50000
| Coverage | Change (pull 14312) | Reference (master) | 
|---|---|---|
| Lines | -0.0154 % | 87.0361 % | 
| Functions | +0.0926 % | 84.1130 % | 
| Branches | -0.0199 % | 51.5451 % | 
160@@ -161,8 +161,10 @@ def main(self):
161         success = TestStatus.FAILED
162 
163         try:
164-            if self.options.usecli and not self.supports_cli:
165-                raise SkipTest("--usecli specified but test does not support using CLI")
166+            if self.options.usecli:
167+                if not self.supports_cli:
168+                    raise SkipTest("--usecli specified but test does not support using CLI")
169+                self.skip_if_no_cli()
1130@@ -1136,7 +1131,6 @@ def serialize(self):
1131     def __repr__(self):
1132         return "msg_block(block=%s)" % (repr(self.block))
1133 
1134-
Concept ACK, agree with rationale.
Mind sharing how you find these unused code?
        
        
          
            
              
              practicalswift
            
          
            
              
              MarcoFalke
            
          
            
              
              DrahtBot
            
          
            
              
              promag
            
          
        
          Labels
          
          
  
    
Tests