Skip to content

Commit 122c405

Browse files
committed
update docstring position arg hash to include source + docstring
1 parent 806e5b3 commit 122c405

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

control/tests/docstrings_test.py

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@
2525

2626
# Checksums to use for checking whether a docstring has changed
2727
function_docstring_hash = {
28-
control.append: 'be014503250ef73253a5372a0d082566',
29-
control.describing_function_plot: '726a10eef8f2b50ef46a203653f398c7',
30-
control.dlqe: '9f637afdf36c7e17b7524f9a736772b6',
31-
control.dlqr: 'a9265c5ed66388661729edb2379fd9a1',
32-
control.lqe: 'd265b0daf0369569e4b755fa35db7a54',
33-
control.lqr: '0b76455c2b873abcbcd959e069d9d241',
34-
control.frd: '7ac3076368f11e407653cd1046bbc98d',
35-
control.margin: '8ee27989f1ca521ce9affe5900605b75',
36-
control.parallel: 'daa3b8708200a364d9b5536b6cbb5c91',
37-
control.series: '7241169911b641c43f9456bd12168271',
38-
control.ss: 'aa77e816305850502c21bc40ce796f40',
39-
control.ss2tf: '8d663d474ade2950dd22ec86fe3a53b7',
40-
control.tf: '4e8d21e71312d83ba2e15b9c095fd962',
41-
control.tf2ss: '0e5da4f3ed4aaf000f3b454c466f9013',
42-
control.markov: '47f3b856ec47df84b2af2c165abaabfc',
43-
control.gangof4: '5e4b4cf815ef76d6c73939070bcd1489',
28+
control.append: '48548c4c4e0083312b3ea9e56174b0b5',
29+
control.describing_function_plot: '95f894706b1d3eeb3b854934596af09f',
30+
control.dlqe: '9db995ed95c2214ce97074b0616a3191',
31+
control.dlqr: '896cfa651dbbd80e417635904d13c9d6',
32+
control.lqe: '567bf657538935173f2e50700ba87168',
33+
control.lqr: 'a3e0a85f781fc9c0f69a4b7da4f0bd22',
34+
control.frd: '099464bf2d14f25a8769ef951adf658b',
35+
control.margin: 'f02b3034f5f1d44ce26f916cc3e51600',
36+
control.parallel: '025c5195a34c57392223374b6244a8c4',
37+
control.series: '9aede1459667738f05cf4fc46603a4f6',
38+
control.ss: '1b9cfad5dbdf2f474cfdeadf5cb1ad80',
39+
control.ss2tf: '48ff25d22d28e7b396e686dd5eb58831',
40+
control.tf: '53a13f4a7f75a31c81800e10c88730ef',
41+
control.tf2ss: '086a3692659b7321c2af126f79f4bc11',
42+
control.markov: '753309de348132ef238e78ac756412c1',
43+
control.gangof4: '0e52eb6cf7ce024f9a41f3ae3ebf04f7',
4444
}
4545

4646
# List of keywords that we can skip testing (special cases)
@@ -138,8 +138,12 @@ def test_parameter_docs(module, prefix):
138138
if obj in function_docstring_hash:
139139
import hashlib
140140
hash = hashlib.md5(
141-
docstring.encode('utf-8')).hexdigest()
142-
assert function_docstring_hash[obj] == hash
141+
(docstring + source).encode('utf-8')).hexdigest()
142+
if function_docstring_hash[obj] != hash:
143+
pytest.fail(
144+
f"source/docstring for {name}() modified; "
145+
f"recheck docstring and update hash to "
146+
f"{hash=}")
143147
continue
144148

145149
# Too complicated to check

0 commit comments

Comments
 (0)