[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [nyx/master] Check for quote types in test



commit fab856eae980a6adcaa451738b8e79146b8199a3
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Fri Apr 10 09:23:27 2015 -0700

    Check for quote types in test
    
    Taking advantage of Stem's new check to keep additions standardized on single
    quotes.
---
 nyx/log_panel.py          |    2 +-
 run_tests.py              |    5 +++--
 test/util/read_tor_log.py |    2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 8650996..f58af4c 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -457,7 +457,7 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
             if entry.runlevel in set_runlevels:
               self.msg_log.append(LogEntry(entry.timestamp, entry.runlevel, entry.message, RUNLEVEL_EVENT_COLOR[entry.runlevel]))
         except IOError as exc:
-          log.info("Unable to read log located at %s: %s" % (logging_location, exc))
+          log.info('Unable to read log located at %s: %s' % (logging_location, exc))
         except ValueError as exc:
           log.info(str(exc))
 
diff --git a/run_tests.py b/run_tests.py
index 17e879d..6e62169 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -58,6 +58,7 @@ def main():
       check_newlines = True,
       check_trailing_whitespace = True,
       check_exception_keyword = True,
+      prefer_single_quotes = True,
     )
 
     for path, issues in pep8_issues.items():
@@ -70,8 +71,8 @@ def main():
     for file_path in static_check_issues:
       print '* %s' % file_path
 
-      for line_number, msg in static_check_issues[file_path]:
-        print '  line %-4s - %s' % (line_number, msg)
+      for issue in static_check_issues[file_path]:
+        print '  line %-4s - %-40s %s' % (issue.line_number, issue.message, issue.line)
 
       print
 
diff --git a/test/util/read_tor_log.py b/test/util/read_tor_log.py
index 3b2ca01..7f84c41 100644
--- a/test/util/read_tor_log.py
+++ b/test/util/read_tor_log.py
@@ -49,7 +49,7 @@ class TestReadTorLog(unittest.TestCase):
       list(read_tor_log(data_path('malformed_runlevel')))
       self.fail("Malformed content should've raised a ValueError")
     except ValueError as exc:
-      self.assertTrue("has an unrecognized runlevel: [unrecognized]" in str(exc))
+      self.assertTrue('has an unrecognized runlevel: [unrecognized]' in str(exc))
 
   def test_with_malformed_date(self):
     try:



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits