summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwim glenn <hey@wimglenn.com>2018-08-29 22:58:04 -0500
committerwim glenn <hey@wimglenn.com>2018-08-30 18:59:58 -0500
commit29c5ac71bc3da35ed631719a43af4c45652d62aa (patch)
tree1720c676c41704bb6398836dc0b2acff829d363c
parent9bd4b0a05ee18e80e4835cd8d42cef1806b9f0f2 (diff)
downloadpytest-29c5ac71bc3da35ed631719a43af4c45652d62aa.tar.gz
improve line width estimate
-rw-r--r--setup.py2
-rw-r--r--src/_pytest/terminal.py8
2 files changed, 4 insertions, 6 deletions
diff --git a/setup.py b/setup.py
index 6207ad09b..a3125611f 100644
--- a/setup.py
+++ b/setup.py
@@ -59,7 +59,7 @@ def get_environment_marker_support_level():
def main():
extras_require = {}
install_requires = [
- "py>=1.5.0",
+ "py>=1.6.0",
"six>=1.10.0",
"setuptools",
"attrs>=17.4.0",
diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py
index 746d08c47..48c652bd0 100644
--- a/src/_pytest/terminal.py
+++ b/src/_pytest/terminal.py
@@ -413,7 +413,7 @@ class TerminalReporter(object):
self._write_progress_information_filling_space()
else:
past_edge = (
- self._tw.chars_on_current_line + self._PROGRESS_LENGTH + 1
+ self._tw.width_of_current_line + self._PROGRESS_LENGTH + 1
>= self._screen_width
)
if past_edge:
@@ -433,10 +433,8 @@ class TerminalReporter(object):
def _write_progress_information_filling_space(self):
msg = self._get_progress_information_message()
- fill = " " * (
- self._tw.fullwidth - self._tw.chars_on_current_line - len(msg) - 1
- )
- self.write(fill + msg, cyan=True)
+ fill = self._tw.fullwidth - self._tw.width_of_current_line - 1
+ self.write(msg.rjust(fill), cyan=True)
def pytest_collection(self):
if not self.isatty and self.config.option.verbose >= 1: