Write tests#

Test framework#

Tests are written using pytest.

Some historical tests are still using unittest but please use pytest for new tests.

Test location#

Tests should be written in a separate file with a name starting with test_. The name should also mention the tested module.

This file should be placed in a test subfolder placed in the folder containing the tested code.

Example

If testing src/silx/io/url.py, place tests in a file called test_url.py in the src/silx/io/test folder.

Test types#

To know more about the different test types, see the testing strategy section of the How we code document.