File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 44from vyper .exceptions import SyntaxException
55
66
7- def test_duplicate_public_annotation ():
8- code = """
9- a: public(public(uint256))
7+ @pytest .mark .parametrize ("annotation" , ("public" , "reentrant" ))
8+ def test_duplicate_getter_annotation (annotation ):
9+ code = f"""
10+ a: { annotation } ({ annotation } (uint256))
1011 """
1112
1213 with pytest .raises (SyntaxException ) as e :
1314 compile_code (code )
1415
15- assert e .value .message == "Used variable annotation `public ` multiple times"
16+ assert e .value .message == f "Used variable annotation `{ annotation } ` multiple times"
1617
1718
18- def test_duplicate_reentrant_annotation ():
19- code = """
20- a: reentrant(reentrant(uint256))
19+ @pytest .mark .parametrize ("annotation" , ("constant" , "transient" , "immutable" ))
20+ def test_duplicate_location_annotation (annotation ):
21+ code = f"""
22+ a: { annotation } ({ annotation } (uint256))
2123 """
2224
2325 with pytest .raises (SyntaxException ) as e :
2426 compile_code (code )
2527
26- assert e .value .message == "Used variable annotation `reentrant` multiple times"
28+ # TODO: improve this error message
29+ assert e .value .message == "Invalid scope for variable declaration"
You can’t perform that action at this time.
0 commit comments