8000 MNT: Rename example files with 'test' in name · matplotlib/matplotlib@873ca91 · GitHub
[go: up one dir, main page]

Skip to content

Commit 873ca91

Browse files
MNT: Rename example files with 'test' in name
In PR 23130 it was noticed that certain example files had 'test' in their name and were getting picked up automatically by pytest accidentally. To avoid this, `testpaths = lib` was added to pytest.ini. While this is sufficient to avoid future problems, removing the word 'test' from example files, and replacing it with 'demo' which is commonly used in other matplotlib examples, provides future safeguards. To further this idea, uses of the phrase 'test' in the example docstrings are replaced with 'demo'. To avoid causing broken links in the example documentation https://matplotlib.org/stable/gallery/index.html add `redirect-from` statements to the old file names as directed in https://matplotlib.org/stable/devel/documenting_mpl.html#moving-documentation.
1 parent 8e2987b commit 873ca91

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

examples/scales/log_test.py renamed to examples/scales/semilogx_demo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
Log Axis
44
========
55
6+
.. redirect-from:: /gallery/scales/log_test
7+
68
This is an example of assigning a log-scale for the x-axis using
79
`~.axes.Axes.semilogx`.
810
"""

examples/text_labels_and_annotations/usetex_baseline_test.py renamed to examples/text_labels_and_annotations/usetex_baseline.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
"""
22
====================
3-
Usetex Baseline Test
3+
Usetex Baseline Demo
44
====================
55
6+
.. redirect-from:: /gallery/text_labels_and_annotations/usetex_baseline_test
7+
68
Comparison of text baselines computed for mathtext and usetex.
79
"""
810

examples/units/artist_tests.py renamed to examples/units/artist_demo.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
"""
2-
============
3-
Artist tests
4-
============
2+
===========
3+
Artist demo
4+
===========
55
6-
Test unit support with each of the Matplotlib primitive artist types.
6+
.. redirect-from:: /gallery/units/artist_tests
7+
8+
Demonstrate unit support with each of the Matplotlib primitive artist types.
79
810
The axis handles unit conversions and the artists keep a pointer to their axis
911
parent. You must initialize the artists with the axis instance if you want to

examples/units/evans_test.py renamed to examples/units/evans_demo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
"""
22
==========
3-
Evans test
3+
Evans demo
44
==========
55
6+
.. redirect-from:: /gallery/units/evans_test
7+
68
A mockup "Foo" units class which supports conversion and different tick
79
formatting depending on the "unit". Here the "unit" is just a scalar
810
conversion factor, but this example shows that Matplotlib is entirely agnostic

0 commit comments

Comments
 (0)
0