Skip to content

Commit 265e725

Browse files
authored
Rewrote test cases to use sys.executable in the command instead of "python" (#1100)
1 parent bc16210 commit 265e725

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

tests/test_scene_rendering/test_caching_related.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import pytest
33
import subprocess
4+
import sys
45

56
from ..utils.commands import capture
67
from ..utils.video_tester import *
@@ -15,7 +16,7 @@ def test_wait_skip(tmp_path, manim_cfg_file, simple_scenes_path):
1516
# Test for PR #468. Intended to test if wait calls are correctly skipped.
1617
scene_name = "SceneWithMultipleWaitCalls"
1718
command = [
18-
"python",
19+
sys.executable,
1920
"-m",
2021
"manim",
2122
simple_scenes_path,
@@ -39,7 +40,7 @@ def test_play_skip(tmp_path, manim_cfg_file, simple_scenes_path):
3940
# Intended to test if play calls are correctly skipped.
4041
scene_name = "SceneWithMultipleCalls"
4142
command = [
42-
"python",
43+
sys.executable,
4344
"-m",
4445
"manim",
4546
simple_scenes_path,

tests/test_scene_rendering/test_cli_flags.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
import sys
23
import numpy as np
34
from PIL import Image
45
from pathlib import Path
@@ -15,7 +16,7 @@
1516
def test_basic_scene_with_default_values(tmp_path, manim_cfg_file, simple_scenes_path):
1617
scene_name = "SquareToCircle"
1718
command = [
18-
"python",
19+
sys.executable,
1920
"-m",
2021
"manim",
2122
simple_scenes_path,
@@ -34,7 +35,7 @@ def test_basic_scene_with_default_values(tmp_path, manim_cfg_file, simple_scenes
3435
def test_basic_scene_l_flag(tmp_path, manim_cfg_file, simple_scenes_path):
3536
scene_name = "SquareToCircle"
3637
command = [
37-
"python",
38+
sys.executable,
3839
"-m",
3940
"manim",
4041
simple_scenes_path,
@@ -55,7 +56,7 @@ def test_basic_scene_l_flag(tmp_path, manim_cfg_file, simple_scenes_path):
5556
def test_n_flag(tmp_path, simple_scenes_path):
5657
scene_name = "SceneWithMultipleCalls"
5758
command = [
58-
"python",
59+
sys.executable,
5960
"-m",
6061
"manim",
6162
simple_scenes_path,
@@ -72,7 +73,7 @@ def test_n_flag(tmp_path, simple_scenes_path):
7273
def test_s_flag_no_animations(tmp_path, manim_cfg_file, simple_scenes_path):
7374
scene_name = "NoAnimations"
7475
command = [
75-
"python",
76+
sys.executable,
7677
"-m",
7778
"manim",
7879
simple_scenes_path,
@@ -96,7 +97,7 @@ def test_s_flag_no_animations(tmp_path, manim_cfg_file, simple_scenes_path):
9697
def test_s_flag(tmp_path, manim_cfg_file, simple_scenes_path):
9798
scene_name = "SquareToCircle"
9899
command = [
99-
"python",
100+
sys.executable,
100101
"-m",
101102
"manim",
102103
simple_scenes_path,
@@ -120,7 +121,7 @@ def test_s_flag(tmp_path, manim_cfg_file, simple_scenes_path):
120121
def test_r_flag(tmp_path, manim_cfg_file, simple_scenes_path):
121122
scene_name = "SquareToCircle"
122123
command = [
123-
"python",
124+
sys.executable,
124125
"-m",
125126
"manim",
126127
simple_scenes_path,
@@ -148,7 +149,7 @@ def test_r_flag(tmp_path, manim_cfg_file, simple_scenes_path):
148149
def test_custom_folders(tmp_path, manim_cfg_file, simple_scenes_path):
149150
scene_name = "SquareToCircle"
150151
command = [
151-
"python",
152+
sys.executable,
152153
"-m",
153154
"manim",
154155
simple_scenes_path,
@@ -173,7 +174,7 @@ def test_custom_folders(tmp_path, manim_cfg_file, simple_scenes_path):
173174
def test_dash_as_filename(tmp_path):
174175
code = "class Test(Scene):\n def construct(self):\n self.add(Circle())\n self.wait(1)"
175176
command = [
176-
"python",
177+
sys.executable,
177178
"-m",
178179
"manim",
179180
"-ql",

0 commit comments

Comments
 (0)