summaryrefslogtreecommitdiff
path: root/doc/sphinxext/tests
diff options
context:
space:
mode:
Diffstat (limited to 'doc/sphinxext/tests')
-rw-r--r--doc/sphinxext/tests/test_docscrape.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/sphinxext/tests/test_docscrape.py b/doc/sphinxext/tests/test_docscrape.py
index 15c9b17f4..4a1f64cf5 100644
--- a/doc/sphinxext/tests/test_docscrape.py
+++ b/doc/sphinxext/tests/test_docscrape.py
@@ -488,3 +488,24 @@ def test_unicode():
""")
assert doc['Summary'][0] == u'öäöäöäöäöåååå'.encode('utf-8')
+
+def test_plot_examples():
+ doc = SphinxDocString("""
+ Examples
+ --------
+ >>> import matplotlib.pyplot as plt
+ >>> plt.plot([1,2,3],[4,5,6])
+ >>> plt.show()
+ """)
+ assert 'plot::' in str(doc), str(doc)
+
+ doc = SphinxDocString("""
+ Examples
+ --------
+ .. plot::
+
+ import matplotlib.pyplot as plt
+ plt.plot([1,2,3],[4,5,6])
+ plt.show()
+ """)
+ assert str(doc).count('plot::') == 1, str(doc)