guidorice / mojo-pytest

Mojo🔥 language test runner plugin for pytest. (aka pytest-mojo)
MIT License
46 stars 1 forks source link

MOJO_ENABLE_ASSERTIONS as a default #16

Closed guidorice closed 2 months ago

guidorice commented 3 months ago

This code from the README shows the opt-in behavior. In early mojo days, this option caused spurious errors and was not reliable.

# mojo assertion failures treated as errors (-D MOJO_ENABLE_ASSERTIONS)
pytest --mojo-assertions

I would like to convert this to a default and change it to an opt-out like:

pytest --disable-mojo-debug-assertions

The docs should also explain that this not any assertion, it's a Debug Assertion which the compiler can elide. (https://docs.modular.com/mojo/stdlib/builtin/debug_assert/debug_assert). Show some code snippets as well to explain the concept.

guidorice commented 3 months ago

Need to re-evaluate if this is feasible, after #17 .

guidorice commented 2 months ago

It appears that -D MOJO_ENABLE_ASSERTIONS does not currently work with mojo test so I am closing this issue. In v24.4 the pytest-mojo plugin will wrap the mojo test cli utility.