Testing¶
Make several tests to reach a good code coverage and verify if results are as expected.
Proposed tests to develop¶
- check parsing
- read a synthetic data and verify theoretical behaviour
- Check paths and files
- Verify means in statistical distributions
- Try different statistical distributions
- Compare results with other tools
Testing tools and procedures¶
In order to make testing, we should use any of the following tools:
- pytest
- hypothesis
pytest examples
“pytest will run all files of the form test_*.py or *_test.py in the current directory and its subdirectories.” So, simply go to the tst directory, and run pytest.
In the environment:
In the code (example from pytest documentation):
How to run test:
From the CLI, write:
** coverage **
Desde el entorno, instalar los paquetes coverage y pytest-cov:
Para calcular la cobertura de código, correr:
Se puede integrar el pytest con el codecov: