Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev: enable catching specific revert messages in pytest runner #1068

Open
enitrat opened this issue Apr 3, 2024 · 3 comments
Open

dev: enable catching specific revert messages in pytest runner #1068

enitrat opened this issue Apr 3, 2024 · 3 comments

Comments

@enitrat
Copy link
Collaborator

enitrat commented Apr 3, 2024

the following

        with_attr error_message("Kakarot: register account address mismatch") {
            assert starknet_address = caller_address;
        }

will not raise an exception with the expected error message, but with

<ExceptionInfo VmException('Error at pc=0:23412:\nAn ASSERT_EQ instruction failed: 34238410343002505708643182162228981218721138754771...108111449060936056937738554844493177996297967078085.', ~/kkrt-labs/kakarot/src/kakarot/library.cairo:246:13) tblen=8>
(Pdb) e.value
VmException('Error at pc=0:23412:\nAn ASSERT_EQ instruction failed: 3423841034300250570864318216222898121872113875477109688986355992595934156170 != 1711920517150125285432159108111449060936056937738554844493177996297967078085.', /Users/msaug/kkrt-labs/kakarot/src/kakarot/library.cairo:246:13)

For a better test coverage we should be able to catch the exception wrapped with the with_attr message

@ClementWalter
Copy link
Member

You mean that the attribute is not used in the test runner?

@enitrat
Copy link
Collaborator Author

enitrat commented Apr 8, 2024

yes, it will fail with the ASSERT_EQ instruction failed message, not the attribute defined

@ClementWalter
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 Backlog
Development

No branches or pull requests

2 participants