Pillow/Tests
DWesl 1b6a8c6122 TST: Parametrize numpy roundtrip to find failing case
Segfaults are annoying to debug.
2022-01-29 13:07:27 +11:00
..
fonts Fix Memory DOS in ImageFont 2021-04-01 17:17:27 +03:00
icc Corrected filename [ci skip] 2016-05-03 19:23:51 +10:00
images Remove consecutive duplicates that only differ by their offset 2022-01-01 14:54:23 +11:00
oss-fuzz Updated path after pillow-wheels switched to libjpeg-turbo 2022-01-01 20:15:06 +11:00
__init__.py Improve pytest configuration to allow specific tests as CLI args 2019-01-13 09:00:12 -08:00
32bit_segfault_check.py Use python3 in shebang line 2021-04-09 19:10:36 +10:00
bench_cffi_access.py Remove old Travis CI config 2020-12-19 21:57:32 +02:00
check_fli_oob.py Added context managers 2021-11-25 23:16:07 +11:00
check_fli_overflow.py Removed PillowTestCase helper class 2020-03-28 12:51:28 +11:00
check_icns_dos.py Added context managers 2021-02-11 21:43:54 +11:00
check_imaging_leaks.py Use python3 in shebang line 2021-04-09 19:10:36 +10:00
check_j2k_dos.py Added context managers 2021-02-11 21:43:54 +11:00
check_j2k_leaks.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
check_j2k_overflow.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
check_jp2_overflow.py Added context managers 2021-11-25 23:16:07 +11:00
check_jpeg_leaks.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
check_large_memory_numpy.py pre-commit autoupdate --freeze 2021-08-12 21:50:09 +10:00
check_large_memory.py pre-commit autoupdate --freeze 2021-08-12 21:50:09 +10:00
check_libtiff_segfault.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
check_png_dos.py Upgrade Python syntax for 3.6+ 2020-07-30 10:09:18 +03:00
conftest.py make sure we return a mark decorator 2021-04-10 12:03:15 +02:00
createfontdatachunk.py Use python3 in shebang line 2021-04-09 19:10:36 +10:00
helper.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2022-01-03 17:11:34 +00:00
README.rst unittest is no longer used in every test [ci skip] 2020-03-27 18:36:36 +11:00
test_000_sanity.py Convert some tests to pytest style 2020-01-18 12:12:10 -08:00
test_binary.py Convert some tests to pytest style 2020-01-18 12:12:10 -08:00
test_bmp_reference.py Changed zero length assertions to falsy 2021-02-11 13:48:31 +11:00
test_box_blur.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_color_lut.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_core_resources.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_decompression_bomb.py Raise an error when performing a negative crop 2022-01-18 16:38:00 +11:00
test_features.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_apng.py Fixed using info dictionary when writing multiple frames 2021-07-13 23:02:23 +10:00
test_file_blp.py Review, typos and lint 2021-04-01 17:41:46 +03:00
test_file_bmp.py Ensure that pixel data offset does not ignore palette 2021-12-21 12:43:50 +11:00
test_file_bufrstub.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_container.py Return strings or bytes from ContainerIO according to the file object mode 2020-02-15 22:13:10 +11:00
test_file_cur.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_dcx.py Changed zero length assertions to falsy 2021-02-11 13:48:31 +11:00
test_file_dds.py pre-commit autoupdate --freeze 2021-08-12 21:50:09 +10:00
test_file_eps.py Added "transparency" argument to load() 2021-07-19 09:08:45 +10:00
test_file_fitsstub.py Resolved FIXME by reading mandatory FITS header items 2021-04-14 22:48:27 +10:00
test_file_fli.py FLI tests for Oss-fuzz crash. 2021-09-02 15:02:27 +03:00
test_file_fpx.py Added context managers 2021-02-11 21:43:54 +11:00
test_file_ftex.py Replaced various instances of assert_image_equal with assert_image_equal_tofile 2021-02-21 22:15:56 +11:00
test_file_gbr.py Replaced various instances of assert_image_equal with assert_image_equal_tofile 2021-02-21 22:15:56 +11:00
test_file_gd.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_gif.py When saving RGBA, make use of first transparent palette entry 2021-12-07 06:37:01 +11:00
test_file_gimpgradient.py Move safe imports to the top of test files 2020-02-17 10:49:27 -08:00
test_file_gimppalette.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_gribstub.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_hdf5stub.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_icns.py Corrected file length in header 2021-11-20 14:17:42 +11:00
test_file_ico.py Read AND mask from end 2021-08-10 07:04:36 +10:00
test_file_im.py Replaced various instances of assert_image_equal with assert_image_equal_tofile 2021-02-21 22:15:56 +11:00
test_file_iptc.py Convert various tests to pytest style 2020-01-27 22:46:52 +11:00
test_file_jpeg.py If appended EOI did not work, do not keep trying 2022-01-01 21:04:32 +11:00
test_file_jpeg2k.py Fixed JPEG2000 I;16 images on big endian 2021-12-28 17:06:05 +11:00
test_file_libtiff_small.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_libtiff.py Pass SAMPLEFORMAT to libtiff 2021-11-23 08:10:18 +11:00
test_file_mcidas.py Replaced various instances of assert_image_equal with assert_image_equal_tofile 2021-02-21 22:15:56 +11:00
test_file_mic.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_mpo.py Merge pull request #5168 from radarhere/mpo 2021-03-07 11:38:36 +02:00
test_file_msp.py Replaced various instances of assert_image_equal with assert_image_equal_tofile 2021-02-21 22:15:56 +11:00
test_file_palm.py Removed CONVERT helper variables 2021-03-22 19:50:06 +00:00
test_file_pcd.py Converted to pytest 2020-02-25 20:57:27 +11:00
test_file_pcx.py Handle PCX images with an odd stride 2021-01-21 19:29:11 +11:00
test_file_pdf.py Use more specific regex chars to prevent ReDoS - exclude carriage return 2021-12-28 10:22:39 +11:00
test_file_pixar.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_png.py Fixed unpacking I;16B to I;16 on big endian 2021-12-28 17:38:01 +11:00
test_file_ppm.py Added context managers 2021-08-24 23:43:38 +10:00
test_file_psd.py Removed unused variables 2022-01-24 11:06:41 +11:00
test_file_sgi.py Added test 2021-07-30 20:29:07 +10:00
test_file_spider.py Replaced various instances of assert_image_equal with assert_image_equal_tofile 2021-02-21 22:15:56 +11:00
test_file_sun.py Replaced various instances of assert_image_equal with assert_image_equal_tofile 2021-02-21 22:15:56 +11:00
test_file_tar.py Changed zero length assertions to falsy 2021-02-11 13:48:31 +11:00
test_file_tga.py Added support for top right and bottom right orientations 2021-11-11 21:53:28 +11:00
test_file_tiff_metadata.py pre-commit autoupdate --freeze 2021-08-12 21:50:09 +10:00
test_file_tiff.py Remove consecutive duplicates that only differ by their offset 2022-01-01 14:54:23 +11:00
test_file_wal.py Added WalImageFile class 2021-07-18 12:35:27 +10:00
test_file_webp_alpha.py Replaced various instances of assert_image_similar with assert_image_similar_tofile 2021-02-21 22:22:29 +11:00
test_file_webp_animated.py Only set info transparency on first frame 2021-03-17 00:24:57 +11:00
test_file_webp_lossless.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_webp_metadata.py lint stuff 2021-04-10 16:58:01 +02:00
test_file_webp.py Upgrade Python syntax with pyupgrade --py36-plus and format with Black 2021-10-19 15:34:52 +03:00
test_file_wmf.py Removed WMF DPI rounding 2021-05-06 20:08:54 +10:00
test_file_xbm.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_xpm.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_xvthumb.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_font_bdf.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_font_leaks.py Rename master to main 2021-10-15 17:30:05 +03:00
test_font_pcf_charsets.py Replaced various instances of assert_image_similar with assert_image_similar_tofile 2021-02-21 22:22:29 +11:00
test_font_pcf.py Replaced various instances of assert_image_similar with assert_image_similar_tofile 2021-02-21 22:22:29 +11:00
test_format_hsv.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_format_lab.py Convert some tests to pytest style 2020-01-18 12:12:10 -08:00
test_image_access.py Added specific error messages when ink has incorrect number of bands 2021-05-19 20:19:57 +10:00
test_image_array.py pre-commit autoupdate --freeze 2021-08-12 21:50:09 +10:00
test_image_convert.py Merge pull request #5824 from radarhere/l_macro 2021-12-28 10:02:36 +02:00
test_image_copy.py Convert various tests to pytest style 2020-01-27 22:46:52 +11:00
test_image_crop.py Raise an error when performing a negative crop 2022-01-18 16:38:00 +11:00
test_image_draft.py Streamline test skipping based on supported features 2020-02-18 13:07:01 -08:00
test_image_entropy.py Replace unittest with pytest 2020-02-13 12:15:05 +02:00
test_image_filter.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_image_frombytes.py Remove im.offset, deprecated in 2001; and fromstring and tostring, deprecated in 2013 2020-07-17 10:55:20 +03:00
test_image_fromqimage.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_image_getbands.py Convert some tests to pytest style 2020-01-18 12:12:10 -08:00
test_image_getbbox.py If an alpha channel is present, only use that to get bounding box 2020-02-28 22:33:02 +11:00
test_image_getcolors.py Convert various tests to pytest style 2020-01-27 22:46:52 +11:00
test_image_getdata.py Convert various tests to pytest style 2020-01-27 22:46:52 +11:00
test_image_getextrema.py Fixed endian handling for I;16 getextrema 2020-02-29 20:29:28 +11:00
test_image_getim.py Convert some tests to pytest style 2020-01-18 12:12:10 -08:00
test_image_getpalette.py Convert some tests to pytest style 2020-01-18 12:12:10 -08:00
test_image_getprojection.py Convert various tests to pytest style 2020-01-27 22:46:52 +11:00
test_image_histogram.py Convert various tests to pytest style 2020-01-27 22:46:52 +11:00
test_image_load.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_image_mode.py Removed duplicate check 2022-01-07 12:34:58 +11:00
test_image_paste.py Do not alter pixels outside mask when drawing text on an image with transparency 2021-04-29 23:08:25 +10:00
test_image_point.py pre-commit autoupdate --freeze 2021-08-12 21:50:09 +10:00
test_image_putalpha.py Convert various tests to pytest style 2020-01-27 22:46:52 +11:00
test_image_putdata.py Raise an error if sequence is not flattened 2021-12-28 09:38:41 +11:00
test_image_putpalette.py Fixed generated palettes 2021-07-29 16:20:20 +10:00
test_image_quantize.py Merge pull request #5879 from radarhere/quantize 2021-12-28 10:08:54 +02:00
test_image_reduce.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_image_resample.py lint stuff 2021-04-10 16:58:01 +02:00
test_image_resize.py Added context managers 2021-11-25 23:16:07 +11:00
test_image_rotate.py Speed up rotating square images by 90 or 270 degrees 2021-07-30 19:57:09 +10:00
test_image_split.py Converted to pytest 2020-02-25 20:57:27 +11:00
test_image_thumbnail.py conditional mark for valgrind ignore 2021-04-09 23:53:24 +02:00
test_image_tobitmap.py Replace unittest with pytest 2020-02-13 12:15:05 +02:00
test_image_tobytes.py Convert some tests to pytest style 2020-01-18 12:12:10 -08:00
test_image_transform.py Copy palette to new image in transform() 2021-07-31 22:49:16 +10:00
test_image_transpose.py Replace unittest with pytest 2020-02-13 12:15:05 +02:00
test_image.py Merge pull request #5891 from shamrin/stable-jupyter-text-output 2022-01-23 10:29:50 +02:00
test_imagechops.py Added context managers 2021-11-25 23:16:07 +11:00
test_imagecms.py Replaced various instances of assert_image_similar with assert_image_similar_tofile 2021-02-21 22:22:29 +11:00
test_imagecolor.py Update test case 2021-09-02 15:03:03 +03:00
test_imagedraw.py Fixed freeing pointer 2021-12-27 13:39:37 +11:00
test_imagedraw2.py Replaced various instances of assert_image_similar with assert_image_similar_tofile 2021-02-21 22:22:29 +11:00
test_imageenhance.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_imagefile.py Merge pull request #5404 from radarhere/feed 2021-12-29 07:33:56 +11:00
test_imagefont.py Upgrade Python syntax with pyupgrade --py36-plus and format with Black 2021-10-19 15:34:52 +03:00
test_imagefontctl.py Remove support for FreeType 2.7 and older 2021-10-18 09:29:53 +03:00
test_imagegrab.py Do not compare properties to themselves 2021-12-26 13:27:41 +11:00
test_imagemath.py Restrict builtins for ImageMath.eval 2022-01-02 17:23:49 +11:00
test_imagemorph.py Changed incorrect mode errors to ValueError 2021-04-18 14:47:05 +10:00
test_imageops_usm.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_imageops.py Instead of drawing border, calculate palette index before image creation in expand() 2021-07-16 20:58:32 +10:00
test_imagepalette.py Fix ResourceWarning: unclosed file 2021-08-24 10:58:02 +03:00
test_imagepath.py Added specific error if coordinate type is incorrect 2022-01-08 13:47:51 +11:00
test_imageqt.py Correct image by scaling pixels 2021-12-15 06:39:05 +11:00
test_imagesequence.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_imageshow.py Deprecated show_file "file" argument in favour of "path" 2022-01-15 16:08:37 +11:00
test_imagestat.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_imagetk.py Revert "Skip due to segmentation fault" 2020-10-04 22:48:23 +01:00
test_imagewin_pointers.py Added context managers 2021-02-11 21:43:54 +11:00
test_imagewin.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_lib_image.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_lib_pack.py Add Tests and support for Planar Tiff Images 2021-03-28 15:03:37 +02:00
test_locale.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_main.py Convert some tests to pytest style 2020-01-18 12:12:10 -08:00
test_map.py Avoid DecompressionBombWarning: Image size (151587072 pixels) exceeds limit of 89478485 pixels, could be decompression bomb DOS attack. 2021-08-24 11:19:45 +03:00
test_mode_i16.py Upgrade Python syntax for 3.6+ 2020-07-30 10:09:18 +03:00
test_numpy.py TST: Parametrize numpy roundtrip to find failing case 2022-01-29 13:07:27 +11:00
test_pdfparser.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_pickle.py Added context managers 2021-11-25 23:16:07 +11:00
test_psdraw.py Corrected error in restoring sys.stdout 2021-05-07 20:44:46 +10:00
test_pyroma.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_qt_image_qapplication.py Moved RGB fix inside ImageQt class 2021-03-10 13:17:19 +11:00
test_qt_image_toqimage.py Replaced various instances of assert_image_equal with assert_image_equal_tofile 2021-02-21 22:15:56 +11:00
test_sgi_crash.py Added context managers 2021-11-25 23:16:07 +11:00
test_shell_injection.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_tiff_crashes.py Filter out UserWarning: Truncated File Read 2021-08-24 11:03:10 +03:00
test_tiff_ifdrational.py Convert to float for comparison with float in IFDRational __eq__ 2021-05-10 08:36:45 +10:00
test_uploader.py Converted to pytest 2020-02-25 20:57:27 +11:00
test_util.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_webp_leaks.py Streamline test skipping based on supported features 2020-02-18 13:07:01 -08:00

Pillow Tests
============

Test scripts are named ``test_xxx.py``. Helper classes and functions can be found in ``helper.py``.

Dependencies
------------

Install::

    python3 -m pip install pytest pytest-cov

Execution
---------

To run an individual test::

    pytest Tests/test_image.py

Or::

    pytest -k test_image.py

Run all the tests from the root of the Pillow source distribution::

    pytest

Or with coverage::

    pytest --cov PIL --cov Tests --cov-report term
    coverage html
    open htmlcov/index.html