Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

changed python version dynamically

Hugues Devimeux4d937d7e7c28
diff --git a/tests/conftest.py b/tests/conftest.py
index 20e1c1250..ffd0ff634 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -57,6 +57,12 @@ class SceneTester:
def Tester():
return SceneTester
[email protected](scope= "module")
+def python_version():
+ if sys.platform == "darwin" :
+ return "python3"
+ return "python"
+
@pytest.fixture
def get_config_test():
"""Function used internally by pytest as a fixture. Return the Configuration for the scenes rendered. The config is the one used when
diff --git a/tests/test_CLI.py b/tests/test_CLI.py
index 6e027b3ea..703cc9b2b 100644
--- a/tests/test_CLI.py
+++ b/tests/test_CLI.py
@@ -12,18 +12,18 @@ def capture(command):
return out, err, proc.returncode
-def test_help():
- command = ["python", "-m", "manim", "--help"]
+def test_help(python_version):
+ command = [python_version, "-m", "manim", "--help"]
out, err, exitcode = capture(command)
assert exitcode == 0, "Manim is not correcly installed. Please refer to the troubleshooting section on the wiki. Error : {}".format(
err)
-def test_basicScene():
+def test_basicScene(python_version):
""" Simulate SquareToCircle. The cache will be saved in tests_caches/media_temp (temporary directory). This is mainly intended to test the partial-movies process. """
path_basic_scene = os.path.join("tests", "tests_data", "basic_scenes.py")
path_output = os.path.join("tests", "tests_cache", "media_temp")
- command = ["python", "-m", "manim", path_basic_scene,
+ command = [python_version, "-m", "manim", path_basic_scene,
"SquareToCircle", "-l", "--media_dir", path_output]
out, err, exitcode = capture(command)
assert exitcode == 0, err
@@ -32,11 +32,11 @@ def test_basicScene():
rmtree(path_output)
-def test_WriteStuff():
+def test_WriteStuff(python_version):
"""Simulate WriteStuff. This is mainly intended to test the caching process of the tex objects"""
path_basic_scene = os.path.join("tests", "tests_data", "basic_scenes.py")
path_output = os.path.join("tests", "tests_cache", "media_temp")
- command = ["python", "-m", "manim", path_basic_scene,
+ command = [python_version, "-m", "manim", path_basic_scene,
"WriteStuff", "-l", "--media_dir", path_output]
out, err, exitcode = capture(command)
assert exitcode == 0, err