AnswerDotAI / AnswerDotAI/nbdev

`nbdev_test` Coverage

Open
#1,290 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
5.3k
Forks
513
Avg merge
2d 30m
Merged PRs (30d)
8

Description

I think it would be very beneficial if the coverage report can be shown when `nbdev_test` also reports the coverages. I don't think (or know) if there is an easy way to do it within the `nbdev` system.

One way that seems to work in my minimal case is first to extract all the tests to test files, and try to reference modules in that test files. It is similar to `nbdev_export`, but tries to export test cases. Then, I run coverage.py on these test files for reporting test coverages.

I am wondering if there exists an easier way that does not require exporting to dedicated test files. Will `nbdev` team officially support this feature?

Contributor guide

Open the contributing guide

Research direction

Start with the nbdev_test and nbdev_export entry points, then examine how coverage.py could observe tests executed from notebooks. Compare that with the proposed dedicated test-file approach. Done means nbdev_test reports useful coverage without requiring exported test files, with the behavior documented and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
testing, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.