Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Properly change cwd and change back as required.

Aathish Sivasubrahmaniane885280cc93d
diff --git a/tests/test_cli/test_cfg_subcmd.py b/tests/test_cli/test_cfg_subcmd.py
index fa6817878..3d55c2776 100644
--- a/tests/test_cli/test_cfg_subcmd.py
+++ b/tests/test_cli/test_cfg_subcmd.py
@@ -5,19 +5,18 @@ import shutil
from test_cli import capture
def test_cfg_help(python_version):
+ os.chdir(os.path.dirname(__file__))
command = [python_version, "-m", "manim", "cfg", "--help"]
out, err, exitcode = capture(command)
assert exitcode == 0, f"The cfg subcommand is not working as intended."
def test_cfg_show(python_version):
- os.chdir(os.path.dirname(__file__))
command = [python_version, "-m", "manim", "cfg", "show"]
out, err, exitcode = capture(command)
assert exitcode == 0
assert f"{os.path.sep}tests{os.path.sep}".encode("utf-8") in out, err
def test_cfg_export(python_version):
- os.chdir(os.path.dirname(__file__))
command = [python_version, "-m", "manim", "cfg", "export", "--dir", "temp"]
out, err, exitcode = capture(command)
assert exitcode == 0
diff --git a/tests/test_cli/test_cli.py b/tests/test_cli/test_cli.py
index 0da7fa9bc..ab0b7b06c 100644
--- a/tests/test_cli/test_cli.py
+++ b/tests/test_cli/test_cli.py
@@ -15,6 +15,7 @@ def capture(command,instream=None):
def test_help(python_version):
+ os.chdir(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
command = [python_version, "-m", "manim", "--help"]
out, err, exitcode = capture(command)
assert exitcode == 0, f"Manim has been installed incorrectly. Please refer to the troubleshooting section on the wiki. Error:\n{err.decode()}"