소스 검색

Fix 2.6 nosetests

Philipp Hagemeister 13 년 전
부모
커밋
8af4ed7b4f
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 2
      test/gentests.py
  2. 3 2
      test/test_download.py

+ 3 - 2
test/gentests.py

@@ -52,13 +52,14 @@ try:
 except AttributeError: # Python 2.6
     def _skip_unless(cond, reason='No reason given'):
         def resfunc(f):
-            def wfunc(*args, **kwargs):
+            # Start the function name with test to appease nosetests-2.6
+            def test_wfunc(*args, **kwargs):
                 if cond:
                     return f(*args, **kwargs)
                 else:
                     print('Skipped test')
                     return
-            return wfunc
+            return test_wfunc
         return resfunc
 _skip = lambda *args, **kwargs: _skip_unless(False, *args, **kwargs)
 

+ 3 - 2
test/test_download.py

@@ -38,13 +38,14 @@ try:
 except AttributeError: # Python 2.6
     def _skip_unless(cond, reason='No reason given'):
         def resfunc(f):
-            def wfunc(*args, **kwargs):
+            # Start the function name with test to appease nosetests-2.6
+            def test_wfunc(*args, **kwargs):
                 if cond:
                     return f(*args, **kwargs)
                 else:
                     print('Skipped test')
                     return
-            return wfunc
+            return test_wfunc
         return resfunc
 _skip = lambda *args, **kwargs: _skip_unless(False, *args, **kwargs)