Skip to content

Commit e89a96d

Browse files
committed
fix test on windows
1 parent 4e28d1f commit e89a96d

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

manim/config/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def make_config_parser(custom_file=None):
7575

7676
other_files = [user_wide, custom_file if custom_file else folder_wide]
7777
parser.read(other_files) # optional files
78+
7879
return parser
7980

8081

tests/test_config.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,23 @@ def test_background_color():
6363
assert np.allclose(frame[0, 0], [255, 255, 255, 255])
6464

6565

66-
def test_digest_file():
66+
def test_digest_file(tmp_path):
6767
"""Test that a config file can be digested programatically."""
6868
assert config["media_dir"] == Path("media")
6969
assert config["video_dir"] == Path("media/videos")
7070

7171
with tempconfig({}):
72-
temp_cfg = tempfile.NamedTemporaryFile()
73-
with open(temp_cfg.name, "w") as file:
74-
file.write(
75-
"""
76-
[CLI]
77-
media_dir = this_is_my_favorite_path
78-
video_dir = {media_dir}/videos
79-
"""
80-
)
81-
config.digest_file(temp_cfg.name)
72+
tmp_cfg = tempfile.NamedTemporaryFile("w", dir=tmp_path, delete=False)
73+
tmp_cfg.write(
74+
"""
75+
[CLI]
76+
media_dir = this_is_my_favorite_path
77+
video_dir = {media_dir}/videos
78+
"""
79+
)
80+
tmp_cfg.close()
81+
config.digest_file(tmp_cfg.name)
82+
8283
assert config["media_dir"] == Path("this_is_my_favorite_path")
8384
assert config["video_dir"] == Path("this_is_my_favorite_path/videos")
8485

0 commit comments

Comments
 (0)