4
4
5
5
import pytest
6
6
7
- from manim import config , tempconfig
8
-
9
7
10
8
@pytest .fixture
11
9
def manim_cfg_file ():
@@ -18,50 +16,39 @@ def simple_scenes_path():
18
16
19
17
20
18
@pytest .fixture
21
- def using_temp_config (tmpdir ):
22
- """Standard fixture that makes tests use a standard_config.cfg with a temp dir."""
23
- with tempconfig (
24
- config .digest_file (Path (__file__ ).parent .parent / "standard_config.cfg" ),
25
- ):
26
- config .media_dir = tmpdir
27
- yield
19
+ def standard_config (config ):
20
+ return config .digest_file (Path (__file__ ).parent .parent / "standard_config.cfg" )
28
21
29
22
30
23
@pytest .fixture
31
- def using_temp_opengl_config (tmpdir ):
24
+ def using_temp_config (tmpdir , standard_config ):
32
25
"""Standard fixture that makes tests use a standard_config.cfg with a temp dir."""
33
- with tempconfig (
34
- config .digest_file (Path (__file__ ).parent .parent / "standard_config.cfg" ),
35
- ):
36
- config .media_dir = tmpdir
37
- config .renderer = "opengl"
38
- yield
26
+ standard_config .media_dir = tmpdir
39
27
40
28
41
29
@pytest .fixture
42
- def disabling_caching ( ):
43
- with tempconfig ({ "disable_caching" : True }):
44
- yield
30
+ def using_temp_opengl_config ( tmpdir , standard_config , using_opengl_renderer ):
31
+ """Standard fixture that makes tests use a standard_config.cfg with a temp dir."""
32
+ standard_config . media_dir = tmpdir
45
33
46
34
47
35
@pytest .fixture
48
- def infallible_scenes_path ( ):
49
- return Path ( __file__ ). parent / "infallible_scenes.py"
36
+ def disabling_caching ( config ):
37
+ config . disable_caching = True
50
38
51
39
52
40
@pytest .fixture
53
- def use_opengl_renderer (enable_preview ):
54
- with tempconfig ({"renderer" : "opengl" , "preview" : enable_preview }):
55
- yield
41
+ def infallible_scenes_path ():
42
+ return Path (__file__ ).parent / "infallible_scenes.py"
56
43
57
44
58
45
@pytest .fixture
59
- def force_window_config_write_to_movie ():
60
- with tempconfig ({ " force_window" : True , "write_to_movie" : True }):
61
- yield
46
+ def force_window_config_write_to_movie (config ):
47
+ config . force_window = True
48
+ config . write_to_movie = True
62
49
63
50
64
51
@pytest .fixture
65
- def force_window_config_pngs ():
66
- with tempconfig ({ " force_window" : True , "format" : "png" }):
67
- yield
52
+ def force_window_config_pngs (config ):
53
+ config . force_window = True
54
+ config . format = "png"
0 commit comments