Skip to content

Make doctest table formatting independent of terminal width - #410

Merged
endrebak merged 1 commit into
masterfrom
codex/portable-doctest-output
Oct 22, 2026
Merged

endrebak merged 1 commit into
masterfrom
codex/portable-doctest-output

Conversation

@endrebak

Copy link
Copy Markdown
Collaborator

Running pytest --doctest-modules pyranges in a narrow or headless environment can hide table columns and fail doctests, even though the values are unchanged. GitHub CI masked this because the formatter forces a 250-column width whenever GITHUB_ACTIONS is set.

Set COLUMNS=250 in an autouse fixture restricted to doctest items. Ordinary tests and normal library display keep their existing settings. Run CI doctests with GITHUB_ACTIONS unset and an initial 80-column width so the GitHub-only workaround can no longer hide this regression.

Validation:

  • Reproduced the reported GenomicFeaturesMethods.tss failure at COLUMNS=80 with GITHUB_ACTIONS unset.
  • After the fix, all 87 doctests and 40 unit tests pass under those conditions on both pandas 2.3.3 and 3.0.6.
  • Confirmed that COLUMNS=250 pytest --doctest-modules pyranges is a working workaround for the existing 0.1.6 source (87 passed).
  • Black, isort and git diff --check pass for the change.

@endrebak
endrebak merged commit 9999c1a into master Oct 22, 2026
11 checks passed
@endrebak
endrebak deleted the codex/portable-doctest-output branch October 22, 2026 10:57
@endrebak

Copy link
Copy Markdown
Collaborator Author

#408

@ghisvail

Copy link
Copy Markdown

Thanks, I can confirm the tests run fine on my end now 🙏

@endrebak

Copy link
Copy Markdown
Collaborator Author

Thanks for reporting. Make sure to try the new version or start new projects with it perhaps :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants