Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test coverage for code #4477

Closed
ekzhu opened this issue Dec 3, 2024 · 1 comment · Fixed by #4847
Closed

Test coverage for code #4477

ekzhu opened this issue Dec 3, 2024 · 1 comment · Fixed by #4847

Comments

@ekzhu
Copy link
Collaborator

ekzhu commented Dec 3, 2024

What feature would you like to be added?

Add code coverage for CI, and poe action.

Why is this needed?

Enforce unit tests coverage

Suggestion

In a Python project, you can define a Poe action in your pyproject.toml to run test coverage using a tool like pytest with the pytest-cov plugin. Here’s an example of how you can configure it:

pyproject.toml

[tool.poe.tasks]
coverage = "pytest --cov=your_package_name --cov-report=term-missing"

Explanation:
• pytest: The testing framework.
• --cov=your_package_name: Specifies the package or module to measure coverage for.
• --cov-report=term-missing: Displays a detailed report in the terminal, showing uncovered lines.

Running the Action

You can run this task by executing the following command in your terminal:

poe coverage

Output

This will run the tests and display a coverage report in the terminal, highlighting which lines of code were not covered by tests.

@ekzhu
Copy link
Collaborator Author

ekzhu commented Dec 23, 2024

@srjoglekar246 here you go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants