Currently, the default width is 80 (e.g. PyTestReporter.write(width=80)) and if
the terminal is wider, the text doesn't automatically wrap, so it looks ugly
--- the [OK] are wrapped, but "." are not.

This patch fixes it by implementing line wrapping.
---
 sympy/utilities/runtests.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/sympy/utilities/runtests.py b/sympy/utilities/runtests.py
index 7a9296f..e88bac7 100644
--- a/sympy/utilities/runtests.py
+++ b/sympy/utilities/runtests.py
@@ -253,6 +253,7 @@ class PyTestReporter(Reporter):
         # this tracks the x-position of the cursor (useful for positioning
         # things on the screen), without the need for any readline library:
         self._write_pos = 0
+        self._line_wrap = False
 
     def root_dir(self, dir):
         self._root_dir = dir
@@ -306,6 +307,10 @@ class PyTestReporter(Reporter):
             # don't use any colors.
             color = ""
 
+        if self._line_wrap:
+            if text[0] != "\n":
+                sys.stdout.write("\n")
+
         if color == "":
             sys.stdout.write(text)
         else:
@@ -316,6 +321,7 @@ class PyTestReporter(Reporter):
             self._write_pos += len(text)
         else:
             self._write_pos = len(text)-l-1
+        self._line_wrap = self._write_pos >= width
         self._write_pos %= width
 
     def write_center(self, text, delim="="):
-- 
1.6.0.4


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-patches" group.
To post to this group, send email to sympy-patches@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sympy-patches?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to