Skip to content

Adding a new feature

Fred Jaya edited this page Jan 17, 2024 · 4 revisions

WIP

New methods and functions should be fully type hinted (where possible) and have docstrings. Adhere to the Coding style guidelines for code and docstrings.

If adding a new feature, you should add new unit tests and these should fully cover your patch.

Note: All tests live under Cogent3/tests with test directory structure and test module names largely mirroring those under Cogent3/src/cogent3.

Checking coverage

Test coverage should always be checked when editing source code.

To generate a local coverage report, change into the Cogent3/tests directory and run

$ pytest --cov-report html --cov cogent3

Open htmlcov/index.html and navigate via the web page to the line(s) edited and check coverage there.

If the code is not tested, please make a note in the PR or confirm on the related issue.