From 5dc8bab08470d81b8922c39720387dd5d0751c98 Mon Sep 17 00:00:00 2001 From: evgeniy-scherbina Date: Tue, 9 Apr 2024 12:01:16 -0400 Subject: [PATCH] Fix python linter errors --- tests/integration_tests/test_grpc_only.py | 3 +-- tests/integration_tests/test_upgrade.py | 6 +----- tests/integration_tests/utils.py | 4 +++- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/integration_tests/test_grpc_only.py b/tests/integration_tests/test_grpc_only.py index 7b3929c155..1aa9e077e6 100644 --- a/tests/integration_tests/test_grpc_only.py +++ b/tests/integration_tests/test_grpc_only.py @@ -116,7 +116,7 @@ def expect_cb(rsp): "--grpc-only", "--home", custom_ethermint.base_dir / "node1", - ], + ], stdout=logfile, stderr=subprocess.STDOUT, ) @@ -152,4 +152,3 @@ def expect_cb(rsp): finally: proc.terminate() proc.wait() - diff --git a/tests/integration_tests/test_upgrade.py b/tests/integration_tests/test_upgrade.py index fa438a6122..6e3f5dcbe2 100644 --- a/tests/integration_tests/test_upgrade.py +++ b/tests/integration_tests/test_upgrade.py @@ -1,12 +1,11 @@ -import time import configparser import json import re import subprocess +import time from pathlib import Path import pytest -from dateutil.parser import isoparse from pystarport import ports from pystarport.cluster import SUPERVISOR_CONFIG_FILE @@ -14,13 +13,10 @@ from .utils import ( ADDRS, CONTRACTS, - find_log_event_attrs, approve_proposal, deploy_contract, - parse_events, send_transaction, wait_for_block, - wait_for_block_time, wait_for_port, ) diff --git a/tests/integration_tests/utils.py b/tests/integration_tests/utils.py index 0b2c588543..253674829d 100644 --- a/tests/integration_tests/utils.py +++ b/tests/integration_tests/utils.py @@ -206,11 +206,13 @@ def find_log_event_attrs(events, ev_type, cond=None): return attrs return None + def approve_proposal(n, rsp, status="PROPOSAL_STATUS_PASSED"): cli = n.cosmos_cli() # get proposal_id tx = cli.query_tx("hash", rsp["txhash"]) + def cb(attrs): return "proposal_id" in attrs ev = find_log_event_attrs(tx["logs"][0]["events"], "submit_proposal", cb) @@ -226,7 +228,7 @@ def cb(attrs): res = cli.query_tally(proposal_id) res = res.get("tally") or res assert ( - int(res["yes_count"]) == cli.staking_pool() + int(res["yes_count"]) == cli.staking_pool() ), "all validators should have voted yes" print("wait for proposal to be activated") proposal = cli.query_proposal(proposal_id)