is_test_contract: fix bug if crytic-compile is not used

pull/478/head
Josselin 5 years ago
parent cc2ff82711
commit 87c307d792
  1. 5
      slither/utils/tests_pattern.py

@ -42,5 +42,8 @@ def is_test_contract(contract: "Contract") -> bool:
return (
_is_test_pattern(contract.name, "Test")
or _is_test_pattern(contract.name, "Mock")
or is_test_file(Path(contract.source_mapping["filename_absolute"]))
or (
contract.source_mapping["filename_absolute"]
and is_test_file(Path(contract.source_mapping["filename_absolute"]))
)
)

Loading…
Cancel
Save