Skip to content

Commit

Permalink
Optimized Tests (#2274)
Browse files Browse the repository at this point in the history
* optimized some tests

* removed out.txt
  • Loading branch information
christopher-besch committed Nov 12, 2021
1 parent 51a8403 commit 24fc316
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
Expand Up @@ -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": []
Expand Down
24 changes: 12 additions & 12 deletions tests/test_scene_rendering/opengl/test_cli_flags_opengl.py
Expand Up @@ -36,22 +36,21 @@ def test_basic_scene_with_default_values(tmp_path, manim_cfg_file, simple_scenes
assert exit_code == 0, err


@pytest.mark.slow()
@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",
Expand Down Expand Up @@ -101,14 +100,15 @@ 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"
command = [
sys.executable,
"-m",
"manim",
"-ql",
"--renderer",
"opengl",
"--write_to_movie",
Expand Down
22 changes: 11 additions & 11 deletions tests/test_scene_rendering/test_cli_flags.py
Expand Up @@ -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",
Expand Down Expand Up @@ -97,14 +96,15 @@ 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"
command = [
sys.executable,
"-m",
"manim",
"-ql",
"-n 3,6",
"--media_dir",
str(tmp_path),
Expand Down

0 comments on commit 24fc316

Please sign in to comment.