Skip to content

Fix _getdimensions for when stdout is redirected #219

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

Closed
wants to merge 1 commit into from

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Apr 5, 2019

This uses an improved version of shutil.get_terminal_width [1], and
also improves the code for before Python 3.3.

1: https://bugs.python.org/issue14841,
python/cpython#12697

blueyed added a commit to blueyed/pytest that referenced this pull request Apr 5, 2019
This might work better then the one from the stdlib [1], and ensures to
use a consistent value for formatting the ini values etc.

1: pytest-dev/py#219
blueyed added a commit to blueyed/pytest that referenced this pull request Apr 5, 2019
This might work better then the one from the stdlib [1], and ensures to
use a consistent value for formatting the ini values etc.

1: pytest-dev/py#219
@blueyed
Copy link
Contributor Author

blueyed commented May 9, 2019

Ping. Pytest could benefit from it.

@blueyed
Copy link
Contributor Author

blueyed commented Aug 12, 2019

btw: it was changed from stdin to stdout in pytest-dev/pytest@ed8e243

This uses an improved version of `shutil.get_terminal_width` [1], and
also improves the code for before Python 3.3.

1: https://bugs.python.org/issue14841,
   python/cpython#12697
blueyed added a commit to blueyed/pytest that referenced this pull request Aug 17, 2019
This might work better then the one from the stdlib [1], and ensures to
use a consistent value for formatting the ini values etc.

1: pytest-dev/py#219
@codecov-io
Copy link

Codecov Report

Merging #219 into master will increase coverage by <.01%.
The diff coverage is 86.44%.

@@            Coverage Diff             @@
##           master     #219      +/-   ##
==========================================
+ Coverage   82.07%   82.07%   +<.01%     
==========================================
  Files          55       55              
  Lines       10153    10198      +45     
  Branches     1141     1149       +8     
==========================================
+ Hits         8333     8370      +37     
- Misses       1556     1560       +4     
- Partials      264      268       +4

1 similar comment
@codecov-io
Copy link

Codecov Report

Merging #219 into master will increase coverage by <.01%.
The diff coverage is 86.44%.

@@            Coverage Diff             @@
##           master     #219      +/-   ##
==========================================
+ Coverage   82.07%   82.07%   +<.01%     
==========================================
  Files          55       55              
  Lines       10153    10198      +45     
  Branches     1141     1149       +8     
==========================================
+ Hits         8333     8370      +37     
- Misses       1556     1560       +4     
- Partials      264      268       +4

blueyed added a commit to blueyed/pytest that referenced this pull request Aug 17, 2019
This might work better then the one from the stdlib [1], and ensures to
use a consistent value for formatting the ini values etc.

1: pytest-dev/py#219
blueyed added a commit to blueyed/pytest that referenced this pull request Aug 17, 2019
`argparse.HelpFormatter` looks at `$COLUMNS` only, falling back to a
default of 80.

`py.io.get_terminal_width()` is smarter there, and could even work
better with pytest-dev/py#219.

This ensures to use a consistent value for formatting the ini values etc.
blueyed added a commit to blueyed/pytest that referenced this pull request Nov 1, 2019
@blueyed
Copy link
Contributor Author

blueyed commented Nov 1, 2019

Will take this into pytest (blueyed/pytest#41), as suggested in pytest-dev/pytest#5056.

@blueyed blueyed closed this Nov 1, 2019
@blueyed blueyed deleted the fix-term-width branch November 1, 2019 09:05
blueyed added a commit to blueyed/pytest that referenced this pull request Nov 1, 2019
blueyed added a commit to blueyed/pytest that referenced this pull request Nov 1, 2019
This uses an improved version of `shutil.get_terminal_width`, mainly to look at stdin, stderr, and stdout.

Ref: https://bugs.python.org/issue14841
Ref: python/cpython#12697

Rejected/stalled in pylib: pytest-dev/py#219
Suggested to move into pytest in pytest-dev#5056.
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