pytest-dev / py

Python development support library (note: maintenance only)
MIT License
67 stars 106 forks source link

Fix _getdimensions for when stdout is redirected #219

Closed blueyed closed 4 years ago

blueyed commented 5 years ago

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, https://github.com/python/cpython/pull/12697

blueyed commented 5 years ago

Ping. Pytest could benefit from it.

blueyed commented 5 years ago

btw: it was changed from stdin to stdout in https://github.com/pytest-dev/pytest/commit/ed8e243

codecov-io commented 5 years ago

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
codecov-io commented 5 years ago

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 commented 4 years ago

Will take this into pytest (https://github.com/blueyed/pytest/pull/41), as suggested in https://github.com/pytest-dev/pytest/pull/5056.