1 Star 0 Fork 0

boyang/manim

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
conftest.py 759 Bytes
一键复制 编辑 原始数据 按行查看 历史
Naveen M K 提交于 2021-05-27 01:21 . Fix tests (#1571)
# This file is automatically picked by pytest
# while running tests. So, that each test is
# run on difference temporary directories and avoiding
# errors.
# If it is running Doctest the current directory
# is changed because it also tests the config module
# itself. If it's a normal test then it uses the
# tempconfig to change directories.
import pytest
from _pytest.doctest import DoctestItem
from manim import config, tempconfig
@pytest.fixture(autouse=True)
def temp_media_dir(tmpdir, monkeypatch, request):
if isinstance(request.node, DoctestItem):
monkeypatch.chdir(tmpdir)
yield tmpdir
else:
with tempconfig({"media_dir": str(tmpdir)}):
assert config.media_dir == str(tmpdir)
yield tmpdir
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/boyang12/manim.git
git@gitee.com:boyang12/manim.git
boyang12
manim
manim
main

搜索帮助