Python源码示例:testtools.skip()
示例1def _get_tmpdir_for_xattr(self):
tmp_rootdir = os.getenv("TMPDIR_FOR_XATTR")
# NOTE(sileht): Don't skip test if user have explicitly set a directory
if not tmp_rootdir:
try:
d = drivers.Driver(tmp_rootdir=tmp_rootdir)
self.useFixture(d)
d._ensure_xattr_support()
except RuntimeError as e:
self.skipTest(str(e))
return tmp_rootdir