Skip to content

Automated Tests: Code Coverage and Standardized Test Infrastructure #13

@hayesall

Description

@hayesall

Currently pytest-cov is reporting 38% code coverage, which is a little on the low side.

It looks like some of the tests are implemented entirely in a __main__ rather than inside the unittest scaffolding (e.g. nnde/differentialequation/examples/tests/test_diff1d_half.py), so this number could be artificially low at the moment.

Recommendation: Implement tests inside a common unittest framework (unittest/nose/pytest) for consistent running and reporting.


Reproducing:

I checked against pytest with pytest-cov to check code coverage.

# (Clone repository)

# Install dependencies and run pytest with the coverage extension
pip install pytest pytest-cov
pytest --cov=nnde nnde/
coverage html

# Open up the coverage report (e.g. Ubunut)
xdg-open htmlcov/index.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions