fix: replace bare except with except Exception in tests/dev/plugins
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Successful in 19s
Deploy to Testnet / deploy-testnet (push) Successful in 1m10s
Multi-Node Stress Testing / stress-test (push) Successful in 2s
Node Failover Simulation / failover-test (push) Successful in 1s
Python Tests / test-python (push) Failing after 7s
Deploy to Testnet / notify-deployment (push) Successful in 1s

- Fixed bare except clauses in dev/examples/wallet.py
- Fixed bare except clauses in dev/gpu/gpu_exchange_status.py (2 clauses)
- Fixed bare except clauses in dev/gpu/gpu_miner_host.py
- Fixed bare except clauses in dev/onboarding/auto-onboard.py
- Fixed bare except clauses in dev/onboarding/onboarding-monitor.py
- Fixed bare except clauses in dev/scripts/dev_heartbeat.py
- Fixed bare except clauses in tests/integration/test_blockchain_simple.py (3 clauses)
- Fixed bare except clause in tests/integration/test_full_workflow.py
- Fixed bare except clause in tests/load_test.py
- Fixed bare except clause in tests/security/test_confidential_transactions.py
- Fixed bare except clause in tests/verification/test_coordinator.py
- All bare except clauses now use proper Exception handling
- Addresses remaining ruff E722 warnings in non-critical code
This commit is contained in:
aitbc
2026-04-30 09:17:05 +02:00
parent 7596ef1c1a
commit eb490a186c
13 changed files with 18 additions and 18 deletions

View File

@@ -27,7 +27,7 @@ def test_nodes():
response = httpx.get(f"{node['url']}/openapi.json", timeout=5)
api_ok = response.status_code == 200
print(f" RPC API: {'' if api_ok else ''}")
except:
except Exception:
api_ok = False
print(f" RPC API: ❌")
@@ -48,7 +48,7 @@ def test_nodes():
)
faucet_ok = response.status_code == 200
print(f" Faucet: {'' if faucet_ok else ''}")
except:
except Exception:
faucet_ok = False
print(f" Faucet: ❌")
@@ -60,7 +60,7 @@ def test_nodes():
})
else:
print(f" Chain Head: ❌")
except:
except Exception:
print(f" Chain Head: ❌")
# Summary

View File

@@ -26,7 +26,7 @@ def test_node_basic_functionality():
try:
response = httpx.get(f"{url}/openapi.json", timeout=5)
print(f" ✅ Node responsive")
except:
except Exception:
print(f" ❌ Node not responding")
continue
@@ -38,7 +38,7 @@ def test_node_basic_functionality():
print(f" ✅ Chain height: {head.get('height', 'unknown')}")
else:
print(f" ❌ Failed to get chain head")
except:
except Exception:
print(f" ❌ Error getting chain head")
# Test faucet
@@ -52,7 +52,7 @@ def test_node_basic_functionality():
print(f" ✅ Faucet working")
else:
print(f" ❌ Faucet failed: {response.status_code}")
except:
except Exception:
print(f" ❌ Error testing faucet")
def show_networking_config():

View File

@@ -231,7 +231,7 @@ class TestMarketplaceIntegration:
if response.status_code == 200:
services = response.json()
assert isinstance(services, list)
except:
except Exception:
# API endpoint might not be available, that's OK
pass

View File

@@ -41,6 +41,6 @@ class AITBCUser(HttpUser):
"payload": "0x",
"chain_id": "ait-mainnet"
})
except:
except Exception:
# Expected to fail due to invalid signature, but tests endpoint availability
pass

View File

@@ -248,7 +248,7 @@ class TestConfidentialTransactionSecurity:
x25519.X25519PrivateKey.generate(),
x25519.X25519PrivateKey.generate().public_key(),
)
except:
except Exception:
pass # Expected to fail with wrong keys
end = time.perf_counter()
times.append(end - start)

View File

@@ -27,7 +27,7 @@ for endpoint in endpoints:
try:
data = response.json()
print(f" Response: {json.dumps(data, indent=2)[:200]}...")
except:
except Exception:
print(f" Response: {response.text[:100]}...")
except Exception as e:
print(f"{endpoint}: Error - {e}")