Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd46840e

Browse files
QuLogictimhoffm
andauthored
Document the text_placeholders fixture
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
1 parent064c10e commitd46840e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎lib/matplotlib/testing/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ def test_imshow_xarray(xr):
129129

130130
@pytest.fixture
131131
def_text_placeholders(monkeypatch):
132+
"""
133+
Replace texts with placeholder rectangles.
134+
135+
The rectangle size only depends on the font size and the number of
136+
characters. It is thus insensitive to font properties and rendering
137+
details. This should be used for tests that depend on text geometries
138+
but not the actual text rendering, e.g. layout tests.
139+
"""
132140
frommatplotlib.patchesimportRectangle
133141

134142
defpatched_get_text_metrics_with_cache(renderer,text,fontprop,ismath,dpi):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp