Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1771df2

Browse files
committed
Add test to confirm that docstrings in code are not affected
1 parent 06237aa commit 1771df2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_rst.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,19 @@ def func(): pass
646646
- raises `ValueError`: if the message_body exceeds 160 characters
647647
"""
648648

649+
SPHINX_NESTED = """\
650+
.. code-block:: python
651+
def foo():
652+
''':param str message_body: blah blah'''
653+
"""
654+
655+
SPHINX_NESTED_MARKDOWN = """\
656+
```python
657+
def foo():
658+
''':param str message_body: blah blah'''
659+
```
660+
"""
661+
649662
RST_CASES = {
650663
'handles prompt continuation and multi-line output': {
651664
'rst': CODE_MULTI_LINE_CODE_OUTPUT,
@@ -788,6 +801,10 @@ def func(): pass
788801
'converts sphinx signatures': {
789802
'rst': SPHINX_SIGNATURE,
790803
'md': SPHINX_SIGNATURE_MARKDOWN
804+
},
805+
'keeps params intact in code blocks': {
806+
'rst': SPHINX_NESTED,
807+
'md': SPHINX_NESTED_MARKDOWN
791808
}
792809
}
793810

0 commit comments

Comments
 (0)