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

[tor-commits] [stem/master] Use builtin SkipTest if it's available



commit 267547286e6375a315e6cb34323feddfdafbcedd
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Mon Jun 5 13:21:28 2017 -0700

    Use builtin SkipTest if it's available
    
    Only providing a SkipTest class if using python 2.6. This way we can drop it
    when we remove python 2.6 support.
---
 stem/util/test_tools.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/stem/util/test_tools.py b/stem/util/test_tools.py
index b7208e3..5a5813f 100644
--- a/stem/util/test_tools.py
+++ b/stem/util/test_tools.py
@@ -51,8 +51,11 @@ CONFIG = stem.util.conf.config_dict('test', {
 TEST_RUNTIMES = {}
 
 
-class SkipTest(Exception):
-  'Notes that the test was skipped.'
+if stem.prereq._is_python_26():
+  class SkipTest(Exception):
+    'Notes that the test was skipped.'
+else:
+  SkipTest = unittest.case.SkipTest
 
 
 class AsyncTest(object):



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