Skip to content

Commit

Permalink
Uncomment test_ast_parsing.vy + remove unnecessary comment
Browse files Browse the repository at this point in the history
  • Loading branch information
talfao committed Feb 4, 2024
1 parent 1780794 commit 2399a7a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
1 change: 0 additions & 1 deletion tests/e2e/detectors/test_detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,6 @@ def id_test(test_item: Test):
"return_bomb.sol",
"0.8.20",
),
## My tests for oracle
Test(all_detectors.OracleDataCheck, "oracle_data_check1.sol", "0.8.20"),
Test(all_detectors.OracleDataCheck, "oracle_data_check2.sol", "0.8.20"),
Test(
Expand Down
36 changes: 18 additions & 18 deletions tests/e2e/vyper_parsing/test_ast_parsing.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# from pathlib import Path
# from slither import Slither
from pathlib import Path
from slither import Slither

# TEST_DATA_DIR = Path(__file__).resolve().parent / "test_data"
TEST_DATA_DIR = Path(__file__).resolve().parent / "test_data"

# ALL_TESTS = list(Path(TEST_DATA_DIR).glob("*.vy"))
ALL_TESTS = list(Path(TEST_DATA_DIR).glob("*.vy"))


# def pytest_generate_tests(metafunc):
# test_cases = []
# for test_file in ALL_TESTS:
# sl = Slither(test_file.as_posix())
# for contract in sl.contracts:
# if contract.is_interface:
# continue
# for func_or_modifier in contract.functions:
# test_cases.append(
# (func_or_modifier.canonical_name, func_or_modifier.slithir_cfg_to_dot_str())
# )
def pytest_generate_tests(metafunc):
test_cases = []
for test_file in ALL_TESTS:
sl = Slither(test_file.as_posix())
for contract in sl.contracts:
if contract.is_interface:
continue
for func_or_modifier in contract.functions:
test_cases.append(
(func_or_modifier.canonical_name, func_or_modifier.slithir_cfg_to_dot_str())
)

# metafunc.parametrize("test_case", test_cases, ids=lambda x: x[0])
metafunc.parametrize("test_case", test_cases, ids=lambda x: x[0])


# def test_vyper_cfgir(test_case, snapshot):
# assert snapshot() == test_case[1]
def test_vyper_cfgir(test_case, snapshot):
assert snapshot() == test_case[1]

0 comments on commit 2399a7a

Please sign in to comment.