testutils.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:AshsSDK 作者: thehappydinoa 项目源码 文件源码
def skip_if_windows(reason):
    """Decorator to skip tests that should not be run on windows.

    Example usage:

        @skip_if_windows("Not valid")
        def test_some_non_windows_stuff(self):
            self.assertEqual(...)

    """
    def decorator(func):
        return unittest.skipIf(
            platform.system() not in ['Darwin', 'Linux'], reason)(func)
    return decorator
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号