This PR adds target pytest which generates test coverage. Currently the coverage is pretty bad (~30%). This PR also includes tests which covers more lines in core functionality i.e. moose.py file. Over the time, more tests can be added to increase the coverage.
C++ code coverage is not implemented in this PR. To do so, all tests have to run as one single giant python code. That means there will be duplicates. For example testa.py creates moose.Pool('/model/a') and testb.py also creates moose.Pool('/model/a'). This is fine iftesta.pyandtestsb.py` runs independently but when run as a single file, there is a duplicate. Most tests will fail.
This can be implemented in the future if a function like moose.clean() is available which cleanup all the objects created during a tests and new test can starts from a clean slate.
This PR adds target
pytest
which generates test coverage. Currently the coverage is pretty bad (~30%). This PR also includes tests which covers more lines in core functionality i.e.moose.py
file. Over the time, more tests can be added to increase the coverage.C++
code coverage is not implemented in this PR. To do so, all tests have to run as one single giant python code. That means there will be duplicates. For exampletesta.py
createsmoose.Pool('/model/a')
andtestb.py
also createsmoose.Pool('/model/a'). This is fine if
testa.pyand
testsb.py` runs independently but when run as a single file, there is a duplicate. Most tests will fail.This can be implemented in the future if a function like
moose.clean()
is available which cleanup all the objects created during a tests and new test can starts from a clean slate.Current coverage report.
$ coverage html # to generate a neat html