[JOSS] create tests for Python

Issue #9 resolved
Andrea Zonca created an issue

Running the C++ unit tests is complicated because relies on GoogleTest which is not easy to install.

I think it would be easier to run some tests in Python.

It would be nice to add a couple of asserts at the end of the one or more of the notebook tutorials and use the tutorials as tests.

Then you can use nbval to run those as part of pytest https://github.com/computationalmodelling/nbval

Ideally (and optionally) you could run these in a Bitbucket pipeline to test the code at every commit.

Comments (4)

  1. Gioacchino Wang

    I have integrated the unit-tests into the Bitbucket pipeline upon commits, with indentation checks running in parallel.

    However, most of the unit tests cannot be conveniently merged into the jupyter notebooks, due to the fact that the to-be-tested functions/modules are not wrapped so far, but this is feasible in the near future, as the development team has agreed (early this week) to make a proper SWIG wrapping, but unfortunately, it may not be available in two months.

    The idea of providing the jupyter notebooks is to provide visual inspections of some critical features, e.g., precision checks (which is not convenient to be auto-tested in unit-tests).

    But I can provide a python script for checking the wrapper, just to prevent stupid and obvious mistakes during future development.

  2. Andrea Zonca reporter

    unit tests are fine in C++.

    My preference would be to run the notebooks tutorials as part of the tests, so that they never become outdated.

    However if that is too complicated, then a simple test script that at least checks that the wrapper runs is sufficient.

  3. Log in to comment