Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/4.x] Cherry pick: Do not compare types, use isinstance() (#5566) #5567

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/election.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_kill_primary_no_reqs(network, args):
res = c.get("/app/commit?view_history=true")
assert res.status_code == http.HTTPStatus.OK
assert "view_history" in res.body.json()
assert type(res.body.json()["view_history"]) == list
assert isinstance(res.body.json()["view_history"], list)
old_view_history = res.body.json()["view_history"]

old_primary.stop()
Expand All @@ -45,7 +45,7 @@ def test_kill_primary_no_reqs(network, args):
res = c.get("/app/commit?view_history=true")
assert res.status_code == http.HTTPStatus.OK
assert "view_history" in res.body.json()
assert type(res.body.json()["view_history"]) == list
assert isinstance(res.body.json()["view_history"], list)
new_view_history = res.body.json()["view_history"]
# Check that the view history has been updated with a new term for the new primary
# new view history should be longer than old view history but may be more than one ahead due to multiple rounds occurring.
Expand Down Expand Up @@ -126,7 +126,7 @@ def test_commit_view_history(network, args):
res = c.get("/app/commit?view_history=true")
assert res.status_code == http.HTTPStatus.OK
assert "view_history" in res.body.json()
assert type(res.body.json()["view_history"]) == list
assert isinstance(res.body.json()["view_history"], list)
view_history = res.body.json()["view_history"]

res = c.get("/node/network")
Expand Down