@@ -21,6 +21,7 @@ def temp_style(style_name, settings=None):
21
21
if not settings :
22
22
settings = DUMMY_SETTINGS
23
23
temp_file = f'{ style_name } .mplstyle'
24
+ orig_library_paths = style .USER_LIBRARY_PATHS
24
25
try :
25
26
with TemporaryDirectory () as tmpdir :
26
27
# Write style settings to file in the tmpdir.
@@ -32,6 +33,7 @@ def temp_style(style_name, settings=None):
32
33
style .reload_library ()
33
34
yield
34
35
finally :
36
+ style .USER_LIBRARY_PATHS = orig_library_paths
35
37
style .reload_library ()
36
38
37
39
@@ -46,8 +48,17 @@ def test_invalid_rc_warning_includes_filename(caplog):
46
48
47
49
48
50
def test_available ():
49
- with temp_style ('_test_' , DUMMY_SETTINGS ):
50
- assert '_test_' in style .available
51
+ # Private name should not be listed in available but still usable.
52
+ assert '_classic_test_patch' not in style .available
53
+ assert '_classic_test_patch' in style .library
54
+
55
+ with temp_style ('_test_' , DUMMY_SETTINGS ), temp_style ('dummy' , DUMMY_SETTINGS ):
56
+ assert 'dummy' in style .available
57
+ assert 'dummy' in style .library
58
+ assert '_test_' not in style .available
59
+ assert '_test_' in style .library
60
+ assert 'dummy' not in style .available
61
+ assert '_test_' not in style .available
51
62
52
63
53
64
def test_use ():
0 commit comments