[tor-commits] [stem/master] test_event_handling failed with python 2.6

atagar at torproject.org atagar at torproject.org
Wed May 13 06:06:01 UTC 2015


commit 222b478200aecedf41cfcba30a14a8610f40c8f2
Author: Damian Johnson <atagar at torproject.org>
Date:   Tue May 12 22:57:56 2015 -0700

    test_event_handling failed with python 2.6
    
    In python 2.6 the threading.Event object's wait() method returns None (rather
    than a boolean).
    
      ======================================================================
      FAIL: test_event_handling
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/home/atagar/Desktop/stem/test/runner.py", line 127, in wrapped
          return func(self, *args, **kwargs)
        File "/home/atagar/Desktop/stem/test/integ/control/controller.py", line 164, in test_event_handling
          self.assertTrue(event_notice1.wait(10))
      AssertionError
    
      ----------------------------------------------------------------------
      Ran 41 tests in 22.108s
---
 test/integ/control/controller.py |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py
index 2c977f5..84bf58a 100644
--- a/test/integ/control/controller.py
+++ b/test/integ/control/controller.py
@@ -161,11 +161,11 @@ class TestController(unittest.TestCase):
       controller.set_conf('NodeFamily', random_fingerprint())
 
       # Wait for the event. Assert that we get it within 10 seconds
-      self.assertTrue(event_notice1.wait(10))
+      event_notice1.wait(10)
       self.assertEqual(len(event_buffer1), 1)
       event_notice1.clear()
 
-      self.assertTrue(event_notice2.wait(10))
+      event_notice2.wait(10)
       self.assertTrue(len(event_buffer2) >= 1)
       event_notice2.clear()
 
@@ -176,7 +176,7 @@ class TestController(unittest.TestCase):
       buffer2_size = len(event_buffer2)
 
       controller.set_conf('NodeFamily', random_fingerprint())
-      self.assertTrue(event_notice1.wait(10))
+      event_notice1.wait(10)
       self.assertEqual(len(event_buffer1), 2)
       event_notice1.clear()
 



More information about the tor-commits mailing list