[GRASS-dev] About fixing exisiting test

Vaclav Petras wenzeslaus at gmail.com
Sun Apr 17 19:57:11 PDT 2022


On Sun, 17 Apr 2022 at 07:30, Adithya Ambapurkar <adinayyu at gmail.com> wrote:

> ...used %%python...
>

As I mentioned earlier, I don't recommend this approach, but yes, you can
(and have to) use this in the notebook. However, that's for the notebook
only. Unrelated to the actual test code.


> It ran all tests successfully but in output it says raster map not found.
>

This may or may not be a problem. If the tests pass, chances are it is the
correct and expected output. For example, if the test checks the behavior
when a non-existent raster map is used, the message is expected and inside
the test, it likely expects failure rather than success with, e.g., the
assertModuleFail function you have seen.


> ...How to convert it to pytest code as both are different and is there any
> documentation which compares gunittest and pytest. Pytest docs and
> gunittest docs are separate. Example for assertModule and assertModuleFail
> what is its equivalent in pytest.
>

This is all for the actual summer project including the documentation.

All pytest is experimental now and does not have any documentation.
However, general pytest documentation applies:

https://docs.pytest.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20220417/fddfa674/attachment.html>


More information about the grass-dev mailing list