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

tests: Avoid side effect of COLUMNS env var #9813

Merged
merged 1 commit into from
Dec 17, 2020

Conversation

gmc444-b
Copy link
Contributor

Description

Several tests rely on getting the default width of a terminal for
rendering test output. Some PTY environments (in my case the Emacs
shell) set the env var COLUMNS to the terminal width, which can
cause several tests to fail due to formatting mismatches.

Prior to running thesee tests, mock out sys.environ, removing the
COLUMNS env var when present.

Test Plan

The change should only effect environments like my own. After this change, tests pass in my environment. The change can be manually tested in other environments by running

COLUMNS=120 ./runtests.py

before, then after applying the change.

Several tests rely on getting the default width of a terminal for
rendering test output. Some PTY environments (in my case the Emacs
shell) set the env var `COLUMNS` to the terminal width, which can
cause several tests to fail due to formatting mismatches.

Prior to running thesee tests, mock out `sys.environ`, removing the
`COLUMNS` env var when present.
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG. I recall seeing this problem occasionally; thanks for taking the time to track it down!

@gvanrossum gvanrossum merged commit 38409ba into python:master Dec 17, 2020
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