You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Python native doctest module allows the use of docstring examples as tests, to reduce the need to duplicate writing unit tests (and encourage good example documentation). However, when initially testing the implementation of this, test coverage was dramatically increasing, even for functions without doctests in their docstring.
We need to sort out this issue before we can implement doctests. I attempted to generate a response on SO and in #504 in the pytest-cov repository. When the issue is sorted later down the line, we can easily activate this functionality in the pa-aa-toolbox by adding the following lines to the setup.cfg:
[tool:pytest]
addopts = --doctest-modules
The text was updated successfully, but these errors were encountered:
So, reading through the doctest documentation, I decided that I would instead try adding in doctest to unittest discovery, which has now worked as intended, although I would consider that coverage is relatively low still (will need to investigate further). In this method, we explicitly created a function to find and run all doctest examples from a specific module. For the raster module, the code looks like below:
The Python native doctest module allows the use of docstring examples as tests, to reduce the need to duplicate writing unit tests (and encourage good example documentation). However, when initially testing the implementation of this, test coverage was dramatically increasing, even for functions without doctests in their docstring.
We need to sort out this issue before we can implement doctests. I attempted to generate a response on SO and in #504 in the pytest-cov repository. When the issue is sorted later down the line, we can easily activate this functionality in the
pa-aa-toolbox
by adding the following lines to thesetup.cfg
:The text was updated successfully, but these errors were encountered: