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

DOC: discuss pytest assertion rewrites in README #169

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,6 @@ and [a doctest example](https://github.com/scipy/scipy_doctest/blob/main/scipy_d
for more details.


### The SciPy Doctest Pytest Plugin

The pytest plugin enables the use of `scipy_doctest` tools to perform doctests.

Follow the given instructions to utilize the pytest plugin for doctesting.

### NumPy and SciPy wrappers


Expand Down Expand Up @@ -363,6 +357,19 @@ leads to
- `scipy.linalg.det`, collected from `scipy/linalg/__init__.py`, is public.


- *`pytest`'s assertion rewriting*

In some rare cases you may need to either explicitly register the `scipy_doctest`
package with the `pytest` assertion rewriting machinery, or ask it to avoid rewriting
completely, via `pytest --assert=plain`.
See [the `pytest documentation`](https://docs.pytest.org/en/7.1.x/how-to/assert.html)
for more details.

In general, rewriting assertions is not very useful for doctests, as the
output on error is fixed by the doctest machinery anyway. Therefore, we believe
adding `--assert=plain` is reasonable.


## Prior art and related work

- `pytest` provides some limited floating-point aware `NumericLiteralChecker`.
Expand Down