|
62 | 62 | standalone = False |
63 | 63 |
|
64 | 64 | control_module_list = [ |
65 | | - control, control.flatsys, control.optimal, control.phaseplot |
66 | | -] |
| 65 | + control, control.flatsys, control.optimal, control.phaseplot] |
67 | 66 | @pytest.mark.parametrize("module", control_module_list) |
68 | | -def test_sphinx_functions(module): |
| 67 | +def test_sphinx_functions(module, check_legacy=True): |
69 | 68 |
|
70 | 69 | # Look through every object in the package |
71 | 70 | _info(f"Checking module {module}", 1) |
@@ -104,7 +103,8 @@ def test_sphinx_functions(module): |
104 | 103 | case True, _, True, _: |
105 | 104 | _warn(f"deprecated object" + referenced) |
106 | 105 | case True, _, _, True: |
107 | | - _warn(f"legacy object" + referenced) |
| 106 | + if check_legacy: |
| 107 | + _warn(f"legacy object" + referenced) |
108 | 108 | case False, False, False, False: |
109 | 109 | _fail(f"{objname} not referenced in sphinx docs") |
110 | 110 |
|
@@ -160,6 +160,12 @@ def test_config_defaults(): |
160 | 160 | _warn(f"Unknown params in config.rst: {config_rstdocs}") |
161 | 161 |
|
162 | 162 |
|
| 163 | +# Test MATLAB library separately (and after config_defaults) |
| 164 | +def test_sphinx_matlab(): |
| 165 | + import control.matlab |
| 166 | + test_sphinx_functions(control.matlab, check_legacy=False) |
| 167 | + |
| 168 | + |
163 | 169 | def _check_deprecated(obj): |
164 | 170 | with warnings.catch_warnings(): |
165 | 171 | warnings.simplefilter('ignore') # debug via sphinx, not here |
@@ -193,5 +199,6 @@ def _fail(str, level=-1): |
193 | 199 |
|
194 | 200 | for module in control_module_list: |
195 | 201 | test_sphinx_functions(module) |
196 | | - |
197 | 202 | test_config_defaults() |
| 203 | + test_sphinx_matlab() |
| 204 | + |
0 commit comments