manim/tests/test_scene_rendering/conftest.py
Darylgolden 6018ebf445 Revert "Merge branch 'main' of https://github.com/ManimCommunity/manim"
This reverts commit e7f9d23aa7, reversing
changes made to afe91d02b6.
2023-07-31 15:29:39 +08:00

67 lines
1.5 KiB
Python

from __future__ import annotations
from pathlib import Path
import pytest
from manim import config, tempconfig
@pytest.fixture
def manim_cfg_file():
return str(Path(__file__).parent / "manim.cfg")
@pytest.fixture
def simple_scenes_path():
return str(Path(__file__).parent / "simple_scenes.py")
@pytest.fixture
def using_temp_config(tmpdir):
"""Standard fixture that makes tests use a standard_config.cfg with a temp dir."""
with tempconfig(
config.digest_file(Path(__file__).parent.parent / "standard_config.cfg"),
):
config.media_dir = tmpdir
yield
@pytest.fixture
def using_temp_opengl_config(tmpdir):
"""Standard fixture that makes tests use a standard_config.cfg with a temp dir."""
with tempconfig(
config.digest_file(Path(__file__).parent.parent / "standard_config.cfg"),
):
config.media_dir = tmpdir
config.renderer = "opengl"
yield
@pytest.fixture
def disabling_caching():
with tempconfig({"disable_caching": True}):
yield
@pytest.fixture
def infallible_scenes_path():
return str(Path(__file__).parent / "infallible_scenes.py")
@pytest.fixture
def use_opengl_renderer(enable_preview):
with tempconfig({"renderer": "opengl", "preview": enable_preview}):
yield
@pytest.fixture
def force_window_config_write_to_movie():
with tempconfig({"force_window": True, "write_to_movie": True}):
yield
@pytest.fixture
def force_window_config_pngs():
with tempconfig({"force_window": True, "format": "png"}):
yield