[tor-commits] [stem/master] Fix test's 'unavailable' labeling alignment

atagar at torproject.org atagar at torproject.org
Fri Jun 14 18:58:30 UTC 2019


commit 1a11b0cdbb5865b67c12894a9c07cfc456dc0d13
Author: Damian Johnson <atagar at torproject.org>
Date:   Fri Jun 14 10:02:33 2019 -0700

    Fix test's 'unavailable' labeling alignment
    
    When pyflakes/pycodestyle are unavailable we show that in our test's
    'initializing' section. However, at some point we changed our column
    width and because it's referenced in two spots I missed one of 'em.
    
    Changing this to a constant so I don't keep buggering it up.
---
 test/task.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/task.py b/test/task.py
index 1c14e64e..272c4ddf 100644
--- a/test/task.py
+++ b/test/task.py
@@ -44,6 +44,8 @@ import test.output
 
 from test.output import STATUS, ERROR, NO_NL, println
 
+TASK_DESCRIPTION_WIDTH = 40
+
 try:
   # TODO: remove check when dropping python 2.6 support
 
@@ -259,7 +261,7 @@ class Task(object):
     start_time = time.time()
     println('  %s...' % self.label, STATUS, NO_NL)
 
-    padding = 40 - len(self.label)
+    padding = TASK_DESCRIPTION_WIDTH - len(self.label)
     println(' ' * padding, NO_NL)
 
     try:
@@ -322,7 +324,7 @@ class StaticCheckTask(Task):
       return super(StaticCheckTask, self).run()
     else:
       println('  %s...' % self.label, STATUS, NO_NL)
-      println(' ' * (50 - len(self.label)), NO_NL)
+      println(' ' * (TASK_DESCRIPTION_WIDTH - len(self.label)), NO_NL)
       println('unavailable', STATUS)
 
 





More information about the tor-commits mailing list