Skip to content

Commit

Permalink
Merge pull request #38 from zopefoundation/show-skipped-tests
Browse files Browse the repository at this point in the history
Use unittest.skip to skip tests
  • Loading branch information
mgedmin committed Apr 15, 2016
2 parents 4e77e86 + a9303aa commit 322c019
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions BTrees/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,30 @@
##############################################################################

import platform
from unittest import skip


def _skip_wo_ZODB(test_method): #pragma NO COVER
def _skip_wo_ZODB(test_method): # pragma: no COVER
try:
import ZODB
except ImportError: # skip this test if ZODB is not available
def _dummy(*args):
pass
return _dummy
import ZODB # noqa
except ImportError: # skip this test if ZODB is not available
return skip("ZODB not available")(test_method)
else:
return test_method

def _skip_under_Py3k(test_method): #pragma NO COVER

def _skip_under_Py3k(test_method): # pragma: no COVER
try:
unicode
except NameError: # skip this test
def _dummy(*args):
pass
return _dummy
except NameError: # skip this test
return skip("Python 3")(test_method)
else:
return test_method

def _skip_on_32_bits(test_method): #pragma NO COVER

def _skip_on_32_bits(test_method): # pragma: no COVER
if platform.architecture()[0] == '32bit':
def _dummy(*args):
pass
return _dummy
return skip("32-bit platform")(test_method)
return test_method


Expand Down

0 comments on commit 322c019

Please sign in to comment.