Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report details about Pillow when running tests #4189

Merged
merged 2 commits into from Nov 5, 2019
Merged

Report details about Pillow when running tests #4189

merged 2 commits into from Nov 5, 2019

Conversation

cgohlke
Copy link
Contributor

@cgohlke cgohlke commented Nov 2, 2019

This change will print version, installation directory, and features of the Pillow installation being tested. I found this helpful when building and testing Pillow locally. For example:

> py -3.8 -m pytest Tests
================================================================= test session starts ==================================================================
platform win32 -- Python 3.8.0, pytest-5.2.2, py-1.8.0, pluggy-0.13.0
--------------------------------------------------------------------
Pillow 6.2.1
--------------------------------------------------------------------
Python modules loaded from X:\Python38\lib\site-packages\PIL
Binary modules loaded from X:\Python38\lib\site-packages\PIL
--------------------------------------------------------------------
--- PIL CORE support ok
--- TKINTER support ok
--- FREETYPE2 support ok
--- LITTLECMS2 support ok
--- WEBP support ok
--- WEBP Transparency support ok
--- WEBPMUX support ok
--- WEBP Animation support ok
--- JPEG support ok
--- OPENJPEG (JPEG2000) support ok
--- ZLIB (PNG/ZIP) support ok
--- LIBTIFF support ok
--- RAQM (Bidirectional Text) support ok
--------------------------------------------------------------------
rootdir: D:\Build\Pillow\Pillow.git, inifile: setup.cfg
plugins: hypothesis-4.41.3, palladium-1.2.2, cov-2.8.1, forked-1.1.3, xdist-1.30.0
collected 1393 items

Tests\test_000_sanity.py .                                                                                                                        [  0%]
<snip>

@hugovk
Copy link
Member

hugovk commented Nov 2, 2019

Good idea.

Seems the conftest isn't used for example for pytest -k python -m pytest Tests/test_pyroma.py.

There's quite a bit of overlap with #3870. Could any new bits be included in pilinfo() and then maybe something like this?

import io

from PIL import features


def pytest_report_header(config):
    report = io.StringIO()
    features.pilinfo(report)
    return report.getvalue()

Or is this a bit too verbose?

$ python -m pytest Tests
========================================================== test session starts ==========================================================
platform darwin -- Python 3.7.4, pytest-5.2.2, py-1.8.0, pluggy-0.12.0
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/Users/hugo/github/Pillow/.hypothesis/examples')
Test order randomisation NOT enabled. Enable with --random-order or --random-order-bucket=<bucket_type>
--------------------------------------------------------------------
Pillow 7.0.0.dev0
--------------------------------------------------------------------
Python modules loaded from /Users/hugo/github/Pillow/src/PIL
Binary modules loaded from /Users/hugo/github/Pillow/src/PIL
--------------------------------------------------------------------
Python 3.7.4 (default, Oct 12 2019, 18:55:28)
       [Clang 11.0.0 (clang-1100.0.33.8)]
--------------------------------------------------------------------
--- PIL CORE support ok
--- TKINTER support ok
--- FREETYPE2 support ok
--- LITTLECMS2 support ok
--- WEBP support ok
--- WEBP Transparency support ok
--- WEBPMUX support ok
--- WEBP Animation support ok
--- JPEG support ok
--- OPENJPEG (JPEG2000) support ok
--- ZLIB (PNG/ZIP) support ok
--- LIBTIFF support ok
*** RAQM (Bidirectional Text) support not installed
--------------------------------------------------------------------
BLP
Extensions: .blp
Features: open
--------------------------------------------------------------------
BMP image/bmp
Extensions: .bmp
Features: open, save
--------------------------------------------------------------------
BUFR
Extensions: .bufr
Features: open, save
--------------------------------------------------------------------
CUR
Extensions: .cur
Features: open
--------------------------------------------------------------------
DCX
Extensions: .dcx
Features: open
--------------------------------------------------------------------
DDS
Extensions: .dds
Features: open
--------------------------------------------------------------------
DIB image/bmp
Extensions: .dib
Features: open, save
--------------------------------------------------------------------
EPS application/postscript
Extensions: .eps, .ps
Features: open, save
--------------------------------------------------------------------
FITS
Extensions: .fit, .fits
Features: open, save
--------------------------------------------------------------------
FLI
Extensions: .flc, .fli
Features: open
--------------------------------------------------------------------
FPX
Extensions: .fpx
Features: open
--------------------------------------------------------------------
FTEX
Extensions: .ftc, .ftu
Features: open
--------------------------------------------------------------------
GBR
Extensions: .gbr
Features: open
--------------------------------------------------------------------
GIF image/gif
Extensions: .gif
Features: open, save, save_all
--------------------------------------------------------------------
GRIB
Extensions: .grib
Features: open, save
--------------------------------------------------------------------
HDF5
Extensions: .h5, .hdf
Features: open, save
--------------------------------------------------------------------
ICNS image/icns
Extensions: .icns
Features: open, save
--------------------------------------------------------------------
ICO image/x-icon
Extensions: .ico
Features: open, save
--------------------------------------------------------------------
IM
Extensions: .im
Features: open, save
--------------------------------------------------------------------
IMT
Features: open
--------------------------------------------------------------------
IPTC
Extensions: .iim
Features: open
--------------------------------------------------------------------
JPEG image/jpeg
Extensions: .jfif, .jpe, .jpeg, .jpg
Features: open, save
--------------------------------------------------------------------
JPEG2000 image/jp2
Extensions: .j2c, .j2k, .jp2, .jpc, .jpf, .jpx
Features: open, save
--------------------------------------------------------------------
MCIDAS
Features: open
--------------------------------------------------------------------
MIC
Extensions: .mic
Features: open
--------------------------------------------------------------------
MPEG video/mpeg
Extensions: .mpeg, .mpg
Features: open
--------------------------------------------------------------------
MSP
Extensions: .msp
Features: open, save, decode
--------------------------------------------------------------------
PCD
Extensions: .pcd
Features: open
--------------------------------------------------------------------
PCX image/x-pcx
Extensions: .pcx
Features: open, save
--------------------------------------------------------------------
PIXAR
Extensions: .pxr
Features: open
--------------------------------------------------------------------
PNG image/png
Extensions: .apng, .png
Features: open, save
--------------------------------------------------------------------
PPM image/x-portable-anymap
Extensions: .pbm, .pgm, .pnm, .ppm
Features: open, save
--------------------------------------------------------------------
PSD
Extensions: .psd
Features: open
--------------------------------------------------------------------
SGI image/sgi
Extensions: .bw, .rgb, .rgba, .sgi
Features: open, save
--------------------------------------------------------------------
SPIDER
Features: open, save
--------------------------------------------------------------------
SUN
Extensions: .ras
Features: open
--------------------------------------------------------------------
TGA image/x-tga
Extensions: .icb, .tga, .vda, .vst
Features: open, save
--------------------------------------------------------------------
TIFF image/tiff
Extensions: .tif, .tiff
Features: open, save, save_all
--------------------------------------------------------------------
WEBP image/webp
Extensions: .webp
Features: open, save, save_all
--------------------------------------------------------------------
WMF
Extensions: .emf, .wmf
Features: open, save
--------------------------------------------------------------------
XBM image/xbm
Extensions: .xbm
Features: open, save
--------------------------------------------------------------------
XPM image/xpm
Extensions: .xpm
Features: open
--------------------------------------------------------------------
XVTHUMB
Features: open
--------------------------------------------------------------------

rootdir: /Users/hugo/github/Pillow, inifile: setup.cfg
plugins: hypothesis-4.36.2, parallel-0.0.9, xdist-1.30.0, random-order-1.0.4, flaky-3.5.3, black-0.3.5, timeout-1.3.3, rerunfailures-6.0, forked-1.0.1, cov-2.8.1, requests-mock-1.6.0
collected 1390 items

Tests/test_000_sanity.py .                                                                                                        [  0%]
<snip>

If so, perhaps an extra parameter for pilinfo to only return the required info?

@nulano
Copy link
Contributor

nulano commented Nov 2, 2019

There's quite a bit of overlap with #3870. Could any new bits be included in pilinfo() and then maybe something like this?
[snip]
Or is this a bit too verbose?
[snip]
If so, perhaps an extra parameter for pilinfo to only return the required info?

How about merging this with #4091, which adds a parameter to skip the supported file formats?

@hugovk
Copy link
Member

hugovk commented Nov 2, 2019

Yes, I've just merged #4091 so it's now available.

@cgohlke cgohlke closed this Nov 5, 2019
@cgohlke cgohlke reopened this Nov 5, 2019
@hugovk hugovk merged commit 3663af1 into python-pillow:master Nov 5, 2019
@hugovk
Copy link
Member

hugovk commented Nov 5, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants