Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Jan 12, 2025
1 parent 9408dcf commit fd15d4b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tests/functional/syntax/test_event_kwarg_hint.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import warnings

import pytest

from vyper.compiler import compile_code


Expand All @@ -19,15 +17,12 @@ def foo():
expected = "Instantiating events with positional arguments is deprecated "
expected += "as of v0.4.1 and will be disallowed in a future release. "
expected += "Use kwargs instead e.g.:\n"
expected += "```\nIERC20.Transfer(sender=msg.sender, receiver=msg.sender, value=123)\n```"
expected += "```\nlog IERC20.Transfer(sender=msg.sender, receiver=msg.sender, value=123)\n```"

assert len(w) == 1, [s.message for s in w]
assert str(w[0].message).startswith(expected)


# https://github.com/vyperlang/vyper/pull/4275#issuecomment-2394910693
# explains the xfail
@pytest.mark.xfail(raises=AssertionError)
def test_event_hint_single_char_argument():
code = """
from ethereum.ercs import IERC20
Expand All @@ -42,7 +37,7 @@ def foo():
expected = "Instantiating events with positional arguments is deprecated "
expected += "as of v0.4.1 and will be disallowed in a future release. "
expected += "Use kwargs instead e.g.:\n"
expected += "```\nIERC20.Transfer(sender=msg.sender, receiver=msg.sender, value=1)\n```"
expected += "```\nlog IERC20.Transfer(sender=msg.sender, receiver=msg.sender, value=1)\n```"

assert len(w) == 1, [s.message for s in w]
assert str(w[0].message).startswith(expected)

0 comments on commit fd15d4b

Please sign in to comment.