Add running doctest to pytest default#7840
Conversation
|
Can you please run |
pytest.ini
Outdated
| markers = | ||
| mat_ops: mark a test as utilizing matrix operations. | ||
| addopts = --durations=10 | ||
| addopts = --durations=10 --doctest-modules --doctest-continue-on-failure --showlocals |
There was a problem hiding this comment.
Let's leave out continue on failure.
There was a problem hiding this comment.
What is the story behind that?
Usually, it's great to see all problems at once.
There was a problem hiding this comment.
CONTRIBUTING.md describes how contributors can run the test on their own computers. This is much preferred to commits to the repo that send repeated notifications to maintainers. We have 200+ open PRs so we need to reduce interrupts.
|
I question the utility of coverage -- It generates a TON of output on every test run and no one reads it. All this clutter makes it very difficult (and a lot of scrolling!) for first-time contributors to find their error messages in our GitHub Actions output. If someone really wants to understand the holes in test coverage, they can run it on their own computers and on their own time. |
Totally agree, I just noticed that it exists by accident. If tests pass I won't go to see action logs. Maybe some aggregator similar to pre-commit.ci could help with it. I have never used such tools. https://about.codecov.io/pricing/ There are a bunch of GitHub actions that work with coverage. Need to do a bit of experimenting with that https://github.com/marketplace?type=actions&query=python+coverage+ |
pytest.ini
Outdated
| markers = | ||
| mat_ops: mark a test as utilizing matrix operations. | ||
| addopts = --durations=10 | ||
| addopts = --durations=10 --doctest-modules --doctest-continue-on-failure --showlocals |
There was a problem hiding this comment.
CONTRIBUTING.md describes how contributors can run the test on their own computers. This is much preferred to commits to the repo that send repeated notifications to maintainers. We have 200+ open PRs so we need to reduce interrupts.
|
This is the same report but a bit more detailed. def foo():
"""
int(1)
>>> 2
int(2)
>>> 3
"""
|
|
i have moved pytest and coverage setting to pyproject.toml and return |
pyproject.toml
Outdated
| markers = [ | ||
| "mat_ops: mark a test as utilizing matrix operations.", | ||
| ] | ||
| addopts = "--durations=10 --doctest-modules --doctest-continue-on-failure --showlocals" |
There was a problem hiding this comment.
Let's have a list of strings instead if that's possible.
Describe your change:
Add default arguments to pytest.ini. This helps when you want to test your code locally.
Checklist:
Fixes: #{$ISSUE_NO}.