matplotlib / matplotlib/pytest-mpl
default savefig format
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 272
- Forks
- 53
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
In the process of penning #150, I noticed that when capturing the test image to an io.Bytes in-memory buffer:
That the format kwarg to savefig isn't used.
Would you be adverse to defaulting to format='png', particularly when writing to a buffer, as (from what I understand) matplotlib will default to the rcParams to select the file-format to save to the buffer for the image, and this could be a source confusion/issues for hashing repeatability for developers when testing.
i.e., what I'm proposing is that a format='png' is injected into the savefig_kwargs, iff not specified by the caller as a kwarg option in the marker decorator.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie in pytest_mpl/plugin.py beim verlinkten savefig-Aufruf in der Nähe der Zeilen 419–421 und verfolgen Sie dann, wie savefig_kwargs aus dem Marker-Dekorator stammt. Prüfen Sie, wie der In-Memory-Puffer behandelt wird, und verifizieren Sie, dass das Standardformat PNG ist, während ein vom Aufrufer angegebenes Format unverändert bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- matplotlib, python
- Bereich
- testing-qa
- Issue-Typ
- Feature
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 48/100