Repository navigation
Make max_width and max_lines deterministic for testing - #17177
Conversation
…do not fail for e.g. large terminals
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
pre-commit.ci autofix |
mhvk
left a comment
There was a problem hiding this comment.
Looks like a good solution to me!
Co-authored-by: P. L. Lim <[email protected]>
|
Thanks, all! |
…177-on-v6.1.x Backport PR #17177 on branch v6.1.x (Make max_width and max_lines deterministic for testing)
|
Can this, or a solution be ported into doctestplus? I sometimes see similar issues with other libraries when running the tests locally but I never dived deep enough to get a fix for them. |
|
@bsipocz are the failures you see usually related to astropy.table or other packages too? |
|
astropy table prints in astroquery and pyvo |
|
Ok - trying to think about how we could do this without special casing/importing astropy in the plugin. I guess another option would be for astropy to include a pytest 'plugin' that will configure/unconfigure this setting automatically? |
|
Could it live in pytest-astropy? |
|
That's a good idea! |
|
Or in doctestplus with a conditional, but I think both packages use pytest-astropy for convenience, too |
* Max max_width and max_lines deterministic for testing, so that tests do not fail for e.g. large terminals * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Improve context manager Co-authored-by: P. L. Lim <[email protected]> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: P. L. Lim <[email protected]>
I decided to set the values to use for testing to the common default for a terminal rather than -1, because the latter requires some tests to be updated and also generates too large output in the docs. It is easier to set the values to the common defaults (80/24).
Fixes #8691
Fixes #16307