Skip to content

Commit

Permalink
test: document known issue #152 with a test
Browse files Browse the repository at this point in the history
  • Loading branch information
achidlow committed Mar 26, 2024
1 parent b217d7f commit bf5f446
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ filterwarnings = [
# ignore pytest-xdist warning
"ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated."
]
xfail_strict = true

[tool.black]
line-length = 99
Expand Down
22 changes: 22 additions & 0 deletions tests/test_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -1336,3 +1336,25 @@ def clear_state_program(self) -> bool:
# expected error message here is just an example, update test once a better one is available
with pytest.raises(puya.errors.CodeError, match="Invalid use of a type union"):
harness.deploy_from_closure(test)


@pytest.mark.xfail(
reason="Known issue, see https://github.com/algorandfoundation/puya/issues/152",
raises=puya.errors.CodeError,
)
def test_arc4_tuple_element_mutation(harness: _TestHarness) -> None:
def test() -> None:
from puyapy import Contract, arc4

class MyContract(Contract):
def approval_program(self) -> bool:
t = arc4.Tuple((arc4.UInt64(1), arc4.DynamicBytes(b"abc")))
assert t[1].bytes[2:] == b"abc", "initial value"
t[1].extend(arc4.DynamicBytes(b"def"))
assert t[1].bytes[2:] == b"abcdef", "updated value"
return True

def clear_state_program(self) -> bool:
return True

harness.deploy_from_closure(test)

0 comments on commit bf5f446

Please sign in to comment.