Skip to content

Commit 2399a7a

Browse files
committed
Uncomment test_ast_parsing.vy + remove unnecessary comment
1 parent 1780794 commit 2399a7a

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

tests/e2e/detectors/test_detectors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,6 @@ def id_test(test_item: Test):
16791679
"return_bomb.sol",
16801680
"0.8.20",
16811681
),
1682-
## My tests for oracle
16831682
Test(all_detectors.OracleDataCheck, "oracle_data_check1.sol", "0.8.20"),
16841683
Test(all_detectors.OracleDataCheck, "oracle_data_check2.sol", "0.8.20"),
16851684
Test(
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# from pathlib import Path
2-
# from slither import Slither
1+
from pathlib import Path
2+
from slither import Slither
33

4-
# TEST_DATA_DIR = Path(__file__).resolve().parent / "test_data"
4+
TEST_DATA_DIR = Path(__file__).resolve().parent / "test_data"
55

6-
# ALL_TESTS = list(Path(TEST_DATA_DIR).glob("*.vy"))
6+
ALL_TESTS = list(Path(TEST_DATA_DIR).glob("*.vy"))
77

88

9-
# def pytest_generate_tests(metafunc):
10-
# test_cases = []
11-
# for test_file in ALL_TESTS:
12-
# sl = Slither(test_file.as_posix())
13-
# for contract in sl.contracts:
14-
# if contract.is_interface:
15-
# continue
16-
# for func_or_modifier in contract.functions:
17-
# test_cases.append(
18-
# (func_or_modifier.canonical_name, func_or_modifier.slithir_cfg_to_dot_str())
19-
# )
9+
def pytest_generate_tests(metafunc):
10+
test_cases = []
11+
for test_file in ALL_TESTS:
12+
sl = Slither(test_file.as_posix())
13+
for contract in sl.contracts:
14+
if contract.is_interface:
15+
continue
16+
for func_or_modifier in contract.functions:
17+
test_cases.append(
18+
(func_or_modifier.canonical_name, func_or_modifier.slithir_cfg_to_dot_str())
19+
)
2020

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

2323

24-
# def test_vyper_cfgir(test_case, snapshot):
25-
# assert snapshot() == test_case[1]
24+
def test_vyper_cfgir(test_case, snapshot):
25+
assert snapshot() == test_case[1]

0 commit comments

Comments
 (0)