Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Optimized Tests (#2274)

Christopher Besch24fc31633b3f
diff --git a/tests/control_data/videos_data/SceneWithMultipleCallsWithNFlag.json b/tests/control_data/videos_data/SceneWithMultipleCallsWithNFlag.json
index 55b511f84..6af344a8c 100644
--- a/tests/control_data/videos_data/SceneWithMultipleCallsWithNFlag.json
+++ b/tests/control_data/videos_data/SceneWithMultipleCallsWithNFlag.json
@@ -2,11 +2,11 @@
"name": "SceneWithMultipleCallsWithNFlag",
"movie_metadata": {
"codec_name": "h264",
- "width": 1920,
- "height": 1080,
- "avg_frame_rate": "60/1",
+ "width": 854,
+ "height": 480,
+ "avg_frame_rate": "15/1",
"duration": "4.000000",
- "nb_frames": "240"
+ "nb_frames": "60"
},
"section_dir_layout": [],
"section_index": []
diff --git a/tests/test_scene_rendering/opengl/test_cli_flags_opengl.py b/tests/test_scene_rendering/opengl/test_cli_flags_opengl.py
index dca92fba5..70521f8ce 100644
--- a/tests/test_scene_rendering/opengl/test_cli_flags_opengl.py
+++ b/tests/test_scene_rendering/opengl/test_cli_flags_opengl.py
@@ -36,22 +36,21 @@ def test_basic_scene_with_default_values(tmp_path, manim_cfg_file, simple_scenes
assert exit_code == 0, err
def test_resolution_flag(tmp_path, manim_cfg_file, simple_scenes_path):
scene_name = "NoAnimations"
+ # test different separators
resolutions = [
- (720, 480),
- (1280, 720),
- (1920, 1080),
- (2560, 1440),
- (3840, 2160),
- (640, 480),
- (800, 600),
+ (720, 480, ";"),
+ (1280, 720, ","),
+ (1920, 1080, "-"),
+ (2560, 1440, ";"),
+ # (3840, 2160, ","),
+ # (640, 480, "-"),
+ # (800, 600, ";"),
]
- separators = [";", ",", "-"]
-
- for (width, height), separator in itertools.product(resolutions, separators):
+ for (width, height, separator) in resolutions:
command = [
sys.executable,
"-m",
@@ -101,7 +100,7 @@ def test_basic_scene_l_flag(tmp_path, manim_cfg_file, simple_scenes_path):
@pytest.mark.slow
@video_comparison(
"SceneWithMultipleCallsWithNFlag.json",
- "videos/simple_scenes/1080p60/SceneWithMultipleCalls.mp4",
+ "videos/simple_scenes/480p15/SceneWithMultipleCalls.mp4",
)
def test_n_flag(tmp_path, simple_scenes_path):
scene_name = "SceneWithMultipleCalls"
@@ -109,6 +108,7 @@ def test_n_flag(tmp_path, simple_scenes_path):
sys.executable,
"-m",
"manim",
+ "-ql",
"--renderer",
"opengl",
"--write_to_movie",
diff --git a/tests/test_scene_rendering/test_cli_flags.py b/tests/test_scene_rendering/test_cli_flags.py
index 5d920e253..a5dba3cca 100644
--- a/tests/test_scene_rendering/test_cli_flags.py
+++ b/tests/test_scene_rendering/test_cli_flags.py
@@ -38,19 +38,18 @@ def test_basic_scene_with_default_values(tmp_path, manim_cfg_file, simple_scenes
@pytest.mark.slow
def test_resolution_flag(tmp_path, manim_cfg_file, simple_scenes_path):
scene_name = "NoAnimations"
+ # test different separators
resolutions = [
- (720, 480),
- (1280, 720),
- (1920, 1080),
- (2560, 1440),
- (3840, 2160),
- (640, 480),
- (800, 600),
+ (720, 480, ";"),
+ (1280, 720, ","),
+ (1920, 1080, "-"),
+ (2560, 1440, ";"),
+ # (3840, 2160, ","),
+ # (640, 480, "-"),
+ # (800, 600, ";"),
]
- separators = [";", ",", "-"]
-
- for (width, height), separator in itertools.product(resolutions, separators):
+ for (width, height, separator) in resolutions:
command = [
sys.executable,
"-m",
@@ -97,7 +96,7 @@ def test_basic_scene_l_flag(tmp_path, manim_cfg_file, simple_scenes_path):
@pytest.mark.slow
@video_comparison(
"SceneWithMultipleCallsWithNFlag.json",
- "videos/simple_scenes/1080p60/SceneWithMultipleCalls.mp4",
+ "videos/simple_scenes/480p15/SceneWithMultipleCalls.mp4",
)
def test_n_flag(tmp_path, simple_scenes_path):
scene_name = "SceneWithMultipleCalls"
@@ -105,6 +104,7 @@ def test_n_flag(tmp_path, simple_scenes_path):
sys.executable,
"-m",
"manim",
+ "-ql",
"-n 3,6",
"--media_dir",
str(tmp_path),