@@ -68,51 +68,51 @@ def test_context():
68
68
assert mpl .rcParams [PARAM ] == 'gray'
69
69
70
70
71
- def test_context_dict ():
72
- ORIGINAL = 'gray'
73
- VALUE_OTHER = 'blue'
74
- mpl .rcParams [PARAM ] = ORIGINAL
75
- with style .context ({PARAM : VALUE_OTHER }):
76
- assert mpl .rcParams [PARAM ] == VALUE_OTHER
77
- assert mpl .rcParams [PARAM ] == ORIGINAL
71
+ def test_context_with_dict ():
72
+ original_value = 'gray'
73
+ other_value = 'blue'
74
+ mpl .rcParams [PARAM ] = original_value
75
+ with style .context ({PARAM : other_value }):
76
+ assert mpl .rcParams [PARAM ] == other_value
77
+ assert mpl .rcParams [PARAM ] == original_value
78
78
79
79
80
- def test_context_dictname1 ():
80
+ def test_context_with_dict_after_namedstyle ():
81
81
# Test dict after style name where dict modifies the same parameter.
82
- ORIGINAL = 'gray'
83
- VALUE_OTHER = 'blue'
84
- mpl .rcParams [PARAM ] = ORIGINAL
82
+ original_value = 'gray'
83
+ other_value = 'blue'
84
+ mpl .rcParams [PARAM ] = original_value
85
85
with temp_style ('test' , DUMMY_SETTINGS ):
86
- with style .context (['test' , {PARAM : VALUE_OTHER }]):
87
- assert mpl .rcParams [PARAM ] == VALUE_OTHER
88
- assert mpl .rcParams [PARAM ] == ORIGINAL
86
+ with style .context (['test' , {PARAM : other_value }]):
87
+ assert mpl .rcParams [PARAM ] == other_value
88
+ assert mpl .rcParams [PARAM ] == original_value
89
89
90
90
91
- def test_context_dictname2 ():
91
+ def test_context_with_dict_before_namedstyle ():
92
92
# Test dict before style name where dict modifies the same parameter.
93
- ORIGINAL = 'gray'
94
- VALUE_OTHER = 'blue'
95
- mpl .rcParams [PARAM ] = ORIGINAL
93
+ original_value = 'gray'
94
+ other_value = 'blue'
95
+ mpl .rcParams [PARAM ] = original_value
96
96
with temp_style ('test' , DUMMY_SETTINGS ):
97
- with style .context ([{PARAM : VALUE_OTHER }, 'test' ]):
97
+ with style .context ([{PARAM : other_value }, 'test' ]):
98
98
assert mpl .rcParams [PARAM ] == VALUE
99
- assert mpl .rcParams [PARAM ] == ORIGINAL
99
+ assert mpl .rcParams [PARAM ] == original_value
100
100
101
101
102
- def test_context_dictname3 ():
102
+ def test_context_with_union_of_dict_and_namedstyle ():
103
103
# Test dict after style name where dict modifies the a different parameter.
104
- ORIGINAL = 'gray'
105
- PARAM_OTHER = 'text.usetex'
106
- VALUE_OTHER = True
107
- d = {PARAM_OTHER : VALUE_OTHER }
108
- mpl .rcParams [PARAM ] = ORIGINAL
109
- mpl .rcParams [PARAM_OTHER ] = (not VALUE_OTHER )
104
+ original_value = 'gray'
105
+ other_param = 'text.usetex'
106
+ other_value = True
107
+ d = {other_param : other_value }
108
+ mpl .rcParams [PARAM ] = original_value
109
+ mpl .rcParams [other_param ] = (not other_value )
110
110
with temp_style ('test' , DUMMY_SETTINGS ):
111
111
with style .context (['test' , d ]):
112
112
assert mpl .rcParams [PARAM ] == VALUE
113
- assert mpl .rcParams [PARAM_OTHER ] == VALUE_OTHER
114
- assert mpl .rcParams [PARAM ] == ORIGINAL
115
- assert mpl .rcParams [PARAM_OTHER ] == (not VALUE_OTHER )
113
+ assert mpl .rcParams [other_param ] == other_value
114
+ assert mpl .rcParams [PARAM ] == original_value
115
+ assert mpl .rcParams [other_param ] == (not other_value )
116
116
117
117
118
118
if __name__ == '__main__' :
0 commit comments