1 file changed
+17
-0
lines changedLines changed: 17 additions & 0 deletions
@@ -13,6 +13,7 @@
13
13
from matplotlib import _api, _c_internal_utils
14
14
import matplotlib.pyplot as plt
15
15
import matplotlib.colors as mcolors
16
+import matplotlib.rcsetup as rcsetup
16
17
import numpy as np
17
18
from matplotlib.rcsetup import (
18
19
validate_bool,
@@ -31,6 +32,22 @@
31
32
_listify_validator)
32
33
33
34
35
+def test_rc_validators_in_sync():
36
+ # make sure that matplotlibrc.template and rcsetup._validators
37
+ # are in sync.
38
+ rcFile = mpl._rc_params_in_file('matplotlibrc.template',
39
+ # Strip leading comment.
40
+ transform=lambda line: line[1:] if line.startswith("#") else line,
41
+ fail_on_error=True)
42
+ for key, validator in rcsetup._validators.items():
43
+ if (key not in mpl._deprecated_remain_as_none and
44
+ key not in mpl._deprecated_ignore_map and
45
+ key[0]!='_'):
46
+ assert key in list(rcFile.keys())
47
+ for key in list(rcFile.keys()):
48
+ assert key in list(rcsetup._validators.keys())
49
+
50
+
34
51
def test_rcparams(tmpdir):
35
52
mpl.rc('text', usetex=False)
36
53
mpl.rc('lines', linewidth=22)
0 commit comments