manim/tests/test_scene_rendering/test_caching_related.py
NotWearingPants 206db54af5
Migrate more os.path to pathlib in tests (#2991)
* Migrate more `os.path` to `pathlib` in tests

* Convert test fixtures to pathlib

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix mypy errors in tests

* migrate another pathlib instance

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2022-10-26 19:51:38 +02:00

57 lines
1.3 KiB
Python

from __future__ import annotations
import sys
import pytest
from manim import capture
from ..utils.video_tester import *
@pytest.mark.slow
@video_comparison(
"SceneWithMultipleWaitCallsWithNFlag.json",
"videos/simple_scenes/480p15/SceneWithMultipleWaitCalls.mp4",
)
def test_wait_skip(tmp_path, manim_cfg_file, simple_scenes_path):
# Test for PR #468. Intended to test if wait calls are correctly skipped.
scene_name = "SceneWithMultipleWaitCalls"
command = [
sys.executable,
"-m",
"manim",
"-ql",
"--media_dir",
str(tmp_path),
"-n",
"3",
str(simple_scenes_path),
scene_name,
]
out, err, exit_code = capture(command)
assert exit_code == 0, err
@pytest.mark.slow
@video_comparison(
"SceneWithMultiplePlayCallsWithNFlag.json",
"videos/simple_scenes/480p15/SceneWithMultipleCalls.mp4",
)
def test_play_skip(tmp_path, manim_cfg_file, simple_scenes_path):
# Intended to test if play calls are correctly skipped.
scene_name = "SceneWithMultipleCalls"
command = [
sys.executable,
"-m",
"manim",
"-ql",
"--media_dir",
str(tmp_path),
"-n",
"3",
str(simple_scenes_path),
scene_name,
]
out, err, exit_code = capture(command)
assert exit_code == 0, err