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

doctest options NUMBER and ELLIPSIS seem incompatible #13327

Open
4 tasks done
wade-cheng opened this issue Mar 25, 2025 · 1 comment
Open
4 tasks done

doctest options NUMBER and ELLIPSIS seem incompatible #13327

wade-cheng opened this issue Mar 25, 2025 · 1 comment
Labels
plugin: doctests related to the doctests builtin plugin

Comments

@wade-cheng
Copy link

wade-cheng commented Mar 25, 2025

  • a detailed description of the bug or problem you are having
  • output of pip list from the virtual environment you are using (uv tree used)
  • pytest and operating system versions
  • minimal example if possible

The NUMBER option supplied by pytest (https://docs.pytest.org/en/stable/how-to/doctest.html#using-doctest-options) seems incompatible with ELLIPSIS from doctest. That is, I can't seem to shorten outputs in non-exception output with ... while having any float outputs respect rounding.

I have a minimal example with virtual environment at https://github.com/wade-cheng/pytest-doctest-bug. Hopefully this makes reproduction easy.

pytest is the only dependency. uv tree shows

pytest-doctest-bug v0.1.0
└── pytest v8.3.5
    ├── exceptiongroup v1.2.2
    ├── iniconfig v2.1.0
    ├── packaging v24.2
    ├── pluggy v1.5.0
    └── tomli v2.2.1

I have OS

Ubuntu 22.04.5 LTS
64-bit
GNOME Version: 42.9
X11
@wade-cheng
Copy link
Author

If this is a bug, at the very least, it would be nice to have a mention of it next to NUMBER in the pytest docs.

@Zac-HD Zac-HD added the plugin: doctests related to the doctests builtin plugin label Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: doctests related to the doctests builtin plugin
Projects
None yet
Development

No branches or pull requests

2 participants