pelicun.tests.basic.reset_tests

This file is used to reset all expected test result data.

Functions

reset_all_test_data(*[, restore, purge])

Update the expected result pickle files with new results, accepting the values obtained by executing the code as correct from now on.

pelicun.tests.basic.reset_tests.reset_all_test_data(*, restore: bool = True, purge: bool = False) None[source]

Update the expected result pickle files with new results, accepting the values obtained by executing the code as correct from now on.

CAUTION: This function should never be used if tests are failing. Its only purpose is to aid the development of more tests and keeping things tidy. If tests are failing, the specific tests need to be investigated, and after rectifying the cause, new expected test result values should be created at an individual basis.

Note: This function assumes that the interpreter’s current directory is the package root directory (pelicun). The code assumes that the test data directory exists. Data deletion only involves .pcl files that begin with test_ and reside in /pelicun/tests/basic/data.

Parameters:
restore: bool

Whether to re-generate the test result data

purge: bool

Whether to remove the test result data before re-generating the new values.

Raises:
ValueError

If the test directory is not found.

OSError

If the code is ran from the wrong directory. This code is only meant to be executed with the interpreter running in the pelicun directory. Dangerous things may happen otherwise.