Conversation
barseghyanartur
commented
Mar 2, 2026
- Fixes in docs.
- Adding pytest-codeblock for testing documentation examples.
- Adding a new conftest.py for testing documentation examples.
- Replace irrelevant reference/dependency to pytest-coverage with a valid pytest-cov.
- Add pytest-cov configuration.
- Update makefile test command accordingly.
…ples. Adding a new conftest.py for testing documentation examples. Replace irrelevant reference/dependency to pytest-coverage with a valid pytest-cov. Add pytest-cov configuration. Update makefile test command accordingly.
|
Hey @barseghyanartur , thanks for adding this! I noticed that CI wasn't running for external contributors, could you please pull main? That should trigger CI. One minor nit: is it possible to move the conftest to a tests file instead? E.g. [tool.pytest.ini_options]
addopts = [
"-ra",
"-q",
"-p", "tests.docs_fixtures",
"--ignore=local",
]That way to the top level folder stays a bit cleaner. I can also do that in a followup myself though, let me know. |
|
Done. |
|
I actually think it makes sense to separate So, dev would still contain things like On CI, you would then install pyversity Alternatively, |
|
Oops. I see pandas is already in benchmarks. :) So, it could simply be installed on CI as well, before running tests. :) |
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
|
|
||
| test: | ||
| uv run pytest --cov=PACKAGE --cov-report=term-missing | ||
| uv run pytest |
There was a problem hiding this comment.
I just noticed this; this is nicer than it was, but I think ci.yaml also needs a small update now. In codecov I see:
I think this is because we now have both coverage run and pytest-cov running. E.g. in CI I see conflicting 100% and 0% coverage tables. However, your approach is better IMO, so I think the nicest thing to do is to update ci.yaml by changing
# Run tests with coverage
- name: Run tests under coverage
run: |
coverage run --source=pyversity -m pytest
coverage reportto
- name: Run tests
run: uv run pytest That should work I think 🤞
There was a problem hiding this comment.
Or just make test? :)
There was a problem hiding this comment.
ah yes, forgot about my own make commands 🤦
|
LGTM! Thanks for adding this Artur, merging :) |