test_files.py 文件源码

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

项目:pulse2percept 作者: uwescience 项目源码 文件源码
def test_savemoviefiles():
    # This function is deprecated

    if os.name != 'nt':
        # If not on Windows, this should break
        with pytest.raises(OSError):
            files.savemoviefiles('invalid.avi', np.zeros(10), path='./')
    else:
        # Trigger an import error
        with mock.patch.dict("sys.modules", {"PIL": {}}):
            with pytest.raises(ImportError):
                files.savemoviefiles('invalid.avi', np.zeros(10), path='./')

        # smoke test
        with pytest.warns(UserWarning):
            files.savemoviefiles('invalid.avi', np.zeros(10), path='./')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号