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

coverage exclude else: assert False #18273

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ exclude_also =
if TYPE_CHECKING:
^ *@pytest.mark.skip($|\()
benchmark_runner: BenchmarkRunner
else:\s*(#\[^\n]*)?\n(\s+#[^\n]*\n)?\s+assert False
18 changes: 9 additions & 9 deletions chia/_tests/core/data_layer/test_data_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,7 @@ async def test_make_and_cancel_offer(offer_setup: OfferSetup, reference: MakeAnd
break
await offer_setup.full_node_api.farm_blocks_to_puzzlehash(count=1, guarantee_transaction_blocks=True)
await asyncio.sleep(0.5)
else: # pragma: no cover
else:
assert False, "offer was not cancelled"

taker_request = {
Expand Down Expand Up @@ -2124,7 +2124,7 @@ async def test_clear_pending_roots(
finally:
client.close()
await client.await_closed()
else: # pragma: no cover
else:
assert False, "unhandled parametrization"

assert cleared_root == {"success": True, "root": pending_root.marshal()}
Expand Down Expand Up @@ -2352,7 +2352,7 @@ async def test_wallet_log_in_changes_active_fingerprint(
)
assert process.stdout is not None
assert await process.stdout.read() == b""
else: # pragma: no cover
else:
assert False, "unhandled parametrization"

active_fingerprint = cast(int, (await wallet_rpc_api.get_logged_in_fingerprint(request={}))["fingerprint"])
Expand Down Expand Up @@ -3110,7 +3110,7 @@ async def test_pagination_cmds(
finally:
client.close()
await client.await_closed()
else: # pragma: no cover
else:
assert False, "unhandled parametrization"
if max_page_size is None or max_page_size == 100:
assert keys == {
Expand Down Expand Up @@ -3179,7 +3179,7 @@ async def test_pagination_cmds(
"total_bytes": 9,
"total_pages": 2,
}
else: # pragma: no cover
else:
assert False, "unhandled parametrization"


Expand Down Expand Up @@ -3282,7 +3282,7 @@ async def test_unsubmitted_batch_update(
finally:
client.close()
await client.await_closed()
else: # pragma: no cover
else:
assert False, "unhandled parametrization"

await full_node_api.farm_blocks_to_puzzlehash(
Expand Down Expand Up @@ -3420,7 +3420,7 @@ async def test_unsubmitted_batch_update(
finally:
client.close()
await client.await_closed()
else: # pragma: no cover
else:
assert False, "unhandled parametrization"

pending_root = await data_layer.data_store.get_pending_root(store_id=store_id)
Expand Down Expand Up @@ -3550,7 +3550,7 @@ async def test_multistore_update(
update_tx_rec0 = bytes32.from_hexstr(res["tx_id"][0])
else:
assert res == {"success": True}
else: # pragma: no cover
else:
assert False, "unhandled parametrization"

if not submit_on_chain:
Expand Down Expand Up @@ -3587,7 +3587,7 @@ async def test_multistore_update(
res = await client.submit_all_pending_roots(fee=None)

update_tx_rec0 = bytes32.from_hexstr(res["tx_id"][0])
else: # pragma: no cover
else:
assert False, "unhandled parametrization"

await farm_block_with_spend(full_node_api, ph, update_tx_rec0, wallet_rpc_api)
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/core/data_layer/test_data_store_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ async def test_node_internal_must_be_valid_reference(
values["left"] = bad_child_hash
elif side == Side.RIGHT:
values["right"] = bad_child_hash
else: # pragma: no cover
else:
assert False

async with data_store.db_wrapper.writer() as writer:
Expand Down
1 change: 0 additions & 1 deletion chia/consensus/vdf_info_computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ def get_signage_point_vdf_info(
assert curr.finished_challenge_slot_hashes is not None
cc_vdf_challenge = curr.finished_challenge_slot_hashes[-1]
else:
# All cases are handled above
assert False

return (
Expand Down
Loading