5 Star 11 Fork 1

Gitee 极速下载/ManimCommunity-manim

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/ManimCommunity/manim
克隆/下载
conftest.py 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
adeshpande 提交于 2024-06-03 23:39 . Add Ruff Lint (#3780)
# This file is automatically picked by pytest
# while running tests. So, that each test is
# run on difference temporary directories and avoiding
# errors.
from __future__ import annotations
import cairo
import moderngl
# 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
def pytest_report_header(config):
ctx = moderngl.create_standalone_context()
info = ctx.info
ctx.release()
return (
f"\nCairo Version: {cairo.cairo_version()}",
"\nOpenGL information",
"------------------",
f"vendor: {info['GL_VENDOR'].strip()}",
f"renderer: {info['GL_RENDERER'].strip()}",
f"version: {info['GL_VERSION'].strip()}\n",
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mirrors/ManimCommunity-manim.git
git@gitee.com:mirrors/ManimCommunity-manim.git
mirrors
ManimCommunity-manim
ManimCommunity-manim
main

搜索帮助