Skip to content

Commit

Permalink
fix: remove italics from last PR [APE-1168] (#1528)
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey authored Jul 6, 2023
1 parent 2490f02 commit 4787894
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
},
include_package_data=True,
install_requires=[
"click>=8.1.3,<9",
"click>=8.1.3,<8.1.4",
"ijson>=3.1.4,<4",
"importlib-metadata",
"ipython>=8.5.0,<9",
Expand Down
10 changes: 8 additions & 2 deletions src/ape/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,14 @@ def __init__(
# Handle ABI arguments
parts = ""
for idx, ipt in enumerate(inputs_ls):
part = f"{ipt}" if isinstance(ipt, int) else ipt.selector
parts = f"{parts}\n\t{click.style(part, italic=True)}"
if isinstance(ipt, int):
part = f"{ipt}"
else:
# Signature without outputs.
input_args = ", ".join(i.signature for i in ipt.inputs)
part = f"{getattr(ipt, 'name', '__init__')}({input_args})"

parts = f"{parts}\n\t{part}"

suffix = f":\n{parts}"

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_contract_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_deploy_wrong_number_of_arguments(
):
expected = (
r"The number of the given arguments \(0\) do not match what is defined in the "
r"ABI:\n\n\t.*constructor\(uint256\).*"
r"ABI:\n\n\t.*__init__\(uint256 num\).*"
)
with pytest.raises(ArgumentsLengthError, match=expected):
contract_container.deploy(sender=sender)
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_contract_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ def test_contract_transactions(owner, contract_instance):

def test_wrong_number_of_arguments(owner, contract_instance):
if "sol" in contract_instance.contract_type.source_id.lower():
second = r"\n\t.*setNumber\(uint256,address\).*"
second = r"\n\t.*setNumber\(uint256 num, address _address\).*"
else:
second = ""

expected = (
r"The number of the given arguments \(4\) do not match what is defined in the ABI:\n"
r"\n\t.*setNumber\(uint256\).*"
r"\n\t.*setNumber\(uint256 num\).*"
f"{second}"
)
with pytest.raises(ArgumentsLengthError, match=expected):
Expand Down

0 comments on commit 4787894

Please sign in to comment.