How does testing fit into a Maturin module? #990
Replies: 2 comments 6 replies
-
IMO it's pretty much the same as any C/C++ extensions. While you can write and run tests in Rust, I think it'd be better to run it via I don't believe a |
Beta Was this translation helpful? Give feedback.
-
You can sort of do this via cargo features, for example add a off-by-default |
Beta Was this translation helpful? Give feedback.
-
I'm writing a Maturin module (which will either be all-Rust or mixed Python/Rust), and want to add some unit tests to it.
In the pure Python world, this would be easy enough: create a
test
folder, put thetest_*.py
files in it, addpytest
(or whatever framework) to the project dev dependencies, then install and run the tests with your favourite tool (pip
,poetry
,pipenv
etc).But what's the right way to put tests into a Maturin module?
Some considerations:
maturin test
command), or whether the test framework runner tools (e.g.poetry run pytest
) should handle it.Beta Was this translation helpful? Give feedback.
All reactions