fix: add missing imports and enable asyncio_mode for pytest
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Successful in 4s
Deploy to Testnet / deploy-testnet (push) Successful in 1m23s
Multi-Node Stress Testing / stress-test (push) Successful in 7s
Node Failover Simulation / failover-test (push) Successful in 13s
Python Tests / test-python (push) Has been cancelled

- Add import requests to test_block_import.py, test_minimal.py, test_simple_import.py, test_tx_import.py
- Add -o asyncio_mode=auto to pytest command to enable pytest-asyncio
- Fixes NameError and async function not supported errors in python-tests.yml
This commit is contained in:
aitbc
2026-05-05 17:16:12 +02:00
parent a19b4a46bb
commit 8d82b1d01d
5 changed files with 7 additions and 2 deletions

View File

@@ -81,6 +81,7 @@ jobs:
tests/verification/ \
-c /dev/null --rootdir "$PWD" --import-mode=importlib \
--tb=short -q --timeout=30 \
-o asyncio_mode=auto \
--cov=apps --cov=packages --cov=cli --cov-append
- name: Run app and package tests with coverage

View File

@@ -7,6 +7,7 @@ Tests the /rpc/blocks/import POST endpoint functionality
import json
import hashlib
from datetime import datetime, UTC
import requests
# Test configuration
BASE_URL = "https://aitbc.bubuit.net/rpc"
@@ -24,8 +25,8 @@ def test_block_import():
print("=" * 50)
# Get current head to work with existing blockchain
client = AITBCHTTPClient()
head = client.get(f"{BASE_URL}/head")
head_response = requests.get(f"{BASE_URL}/head")
head = head_response.json()
print(f"Current head: height={head['height']}, hash={head['hash']}")
# Use very high heights to avoid conflicts with existing chain

View File

@@ -5,6 +5,7 @@ Minimal test to debug transaction import
import json
import hashlib
import requests
from aitbc import AITBCHTTPClient, NetworkError
BASE_URL = "https://aitbc.bubuit.net/rpc"

View File

@@ -5,6 +5,7 @@ Simple test for block import endpoint without transactions
import json
import hashlib
import requests
from aitbc import AITBCHTTPClient, NetworkError
BASE_URL = "https://aitbc.bubuit.net/rpc"

View File

@@ -5,6 +5,7 @@ Test transaction import specifically
import json
import hashlib
import requests
from aitbc import AITBCHTTPClient, NetworkError
BASE_URL = "https://aitbc.bubuit.net/rpc"