#mojo-pytest: Mojo test runner and pytest plugin

1 messages · Page 1 of 1 (latest)

upper dove
#

By @viscid copper

viscid copper
#

Thanks @upper dove ! I was actually thinking of archiving mojo-pytest, because now mojo has mojo test . 🎉 that seems new- when did that land? v24 I guess. Also there is a nice docs section here: https://docs.modular.com/mojo/tools/testing

Let me know if anyone thinks mojo-pytest is still of any use?

cc @sage mulch

Testing Mojo programs.

sage mulch
#

Oh that is so great, love the implementation!

@viscid copper maybe we could rethink mojo-pytest to use this new tooling, being able to run inside pytest has many benefits, think about VsCode test UI integration for instance.
In the future you could have a Python project with a small portion of it written in Mojo and you would like to run all the tests (Python + Mojo) with the pytest command, then pytest-mojo would do the trick for you 😎

viscid copper
#

@sage mulch good point! I think mixed python + mojo codebase are going to very common. 👍

midnight wigeon
#

I’ve been using mojo pytest to run tests on all my projects for months now! Great project 🙏🏾

viscid copper
#

Thanks @midnight wigeon

viscid copper
viscid copper
viscid copper
viscid copper
minor jasper
# viscid copper Update the docs and the CI script to use mojo v24.5 https://github.com/guidorice...

Hi @viscid copper! I'm using magic to manage my Mojo environment, and it seems like I should be able to add pytest-mojo as a dependency, but it's not working as expected. In short, magic cannot find pytest-mojo in PiPy.
Error message:

× failed to solve the pypi requirements of 'default' 'linux-64'
  ├─▶ failed to resolve pypi dependencies
  ╰─▶ Because pytest-mojo was not found in the package registry and you require pytest-mojo>=24.5,<25, we can conclude that your requirements are
      unsatisfiable.

Here's an excerpt from my mojoproject.toml file. What am I missing?

[pypi-dependencies]
pytest-mojo = ">=24.5, <25"
minor jasper
viscid copper
minor jasper