halmos
halmos copied to clipboard
Error: No tests with the prefix <testFunctionName>
I am currently following recent Cyfrin Updraft course where Patrick teaches how to use halmos. I am unable to follow the tutorial because I keep running into thesame error whenever I try to run a halmos test:
Error: No tests with the prefix check_testMulWadUpFuzz`
Here is the project repo: https://github.com/Cyfrin/2-math-master-audit
Here is what the test looks like:
function check_testMulWadUpFuzz(uint256 x, uint256 y) public pure {
if (x == 0 || y == 0 || y <= type(uint256).max / x) {
uint256 result = MathMasters.mulWadUp(x, y);
uint256 expected = x * y == 0 ? 0 : (x * y - 1) / 1e18 + 1;
assert(result ==expected);
}
}
Command to run the test:
halmos --function check_testMulWadUpFuzz
The complete CL output:
[⠒] Compiling...
[⠒] Compiling 21 files with 0.8.22
[⠰] Solc 0.8.22 finished in 3.44s
Compiler run successful!
Skipped stdStorage.json due to parsing failure: KeyError: 'ast'
Skipped stdStorageSafe.json due to parsing failure: KeyError: 'ast'
Skipped Test.json due to parsing failure: KeyError: 'ast'
Skipped StdInvariant.json due to parsing failure: KeyError: 'ast'
Skipped StdStyle.json due to parsing failure: KeyError: 'ast'
Skipped DSTest.json due to parsing failure: KeyError: 'ast'
Skipped Vm.json due to parsing failure: KeyError: 'ast'
Skipped VmSafe.json due to parsing failure: KeyError: 'ast'
Skipped StdAssertions.json due to parsing failure: KeyError: 'ast'
Skipped CommonBase.json due to parsing failure: KeyError: 'ast'
Skipped TestBase.json due to parsing failure: KeyError: 'ast'
Skipped ScriptBase.json due to parsing failure: KeyError: 'ast'
Skipped stdJson.json due to parsing failure: KeyError: 'ast'
Skipped console.json due to parsing failure: KeyError: 'ast'
Skipped Base_Test.json due to parsing failure: KeyError: 'ast'
Skipped stdMath.json due to parsing failure: KeyError: 'ast'
Skipped safeconsole.json due to parsing failure: KeyError: 'ast'
Skipped StdChains.json due to parsing failure: KeyError: 'ast'
Skipped StdUtils.json due to parsing failure: KeyError: 'ast'
Skipped console2.json due to parsing failure: KeyError: 'ast'
Skipped IMulticall3.json due to parsing failure: KeyError: 'ast'
Skipped StdCheatsSafe.json due to parsing failure: KeyError: 'ast'
Skipped StdCheats.json due to parsing failure: KeyError: 'ast'
Skipped MathMastersTest.json due to parsing failure: KeyError: 'ast'
Skipped MathMasters.json due to parsing failure: KeyError: 'ast'
Skipped stdError.json due to parsing failure: KeyError: 'ast'
Error: No tests with the prefix `check_testMulWadUpFuzz`
Please what could be the possible cause of this error?
Environment:
- OS: Linux Ubuntu
- Python version: Python 3.12.2
- Halmos and other dependency versions: Halmos 0.1.9
Never mind. For anyone experiencing this issue, remove your current installation, and reinstall it with pipx.
Had the same issue, reinstalling halmos with pipx worked.
thanks for reporting the workaround, closing 🫡