Pillow/Tests
Benjamin Gilbert e572722479 Allow configuring JPEG restart marker interval on save
libjpeg allows specifying the marker interval either in MCU blocks or in
MCU rows.  Support both, via separate parameters, rather than requiring
callers to do the math.

Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
2023-10-31 17:47:25 -05:00
..
fonts Add end-of-file-fixer to pre-commit 2023-09-25 16:45:38 +03:00
icc Add end-of-file-fixer to pre-commit 2023-09-25 16:45:38 +03:00
images Use "gray" more consistently 2023-10-19 19:12:01 +11:00
oss-fuzz Switched from direct setup.py invocation to "pip install ." 2023-10-27 19:17:15 +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 Restored 32-bit support 2023-06-27 14:43:58 +10:00
bench_cffi_access.py use same print format regardless of iterations 2023-06-22 09:16:18 -05:00
check_fli_oob.py Added context managers 2021-11-25 23:16:07 +11:00
check_fli_overflow.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00: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 Add check-executables-have-shebangs to pre-commit and remove executable flags 2023-09-25 16:45:38 +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 Test lists and tuples 2023-02-13 10:34:44 -06:00
check_large_memory_numpy.py Restored 32-bit support 2023-06-27 14:43:58 +10:00
check_large_memory.py Restored 32-bit support 2023-06-27 14:43:58 +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 [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
check_release_notes.py Simplify glob 2023-04-09 22:43:36 +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 Fix LOG005 use exception() within an exception handler 2023-09-25 16:45:38 +03:00
README.rst Added pytest-timeout to test dependencies 2022-05-16 08:56:45 +10:00
test_000_sanity.py Do not import PIL.Image 2022-10-03 19:54:37 +11:00
test_binary.py Convert some tests to pytest style 2020-01-18 12:12:10 -08:00
test_bmp_reference.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_box_blur.py Allow GaussianBlur and BoxBlur to accept a sequence of x and y radii 2023-08-12 12:09:20 +10:00
test_color_lut.py Merge pull request #6195 from hugovk/cleanup 2022-04-26 18:51:44 +10:00
test_core_resources.py Restored 32-bit support 2023-06-27 14:43:58 +10:00
test_decompression_bomb.py Limit size even if one dimension is zero 2023-06-28 11:43:05 +10:00
test_deprecate.py Removed ImageFont.getsize and related functions 2023-04-10 16:56:13 +10:00
test_features.py Parametrized tests 2022-10-03 16:57:42 +11:00
test_file_apng.py Use "gray" more consistently 2023-10-19 19:12:01 +11:00
test_file_blp.py Remove constants deprecated in 9.1.0 2023-04-06 16:11:36 +03:00
test_file_bmp.py Use "gray" more consistently 2023-10-19 19:12:01 +11:00
test_file_bufrstub.py Fix unclosed file warnings 2023-03-11 22:39:11 +11:00
test_file_container.py Parametrize tests 2022-08-23 21:41:32 +10:00
test_file_cur.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_dcx.py Removed "del im" 2023-03-03 10:28:36 +02:00
test_file_dds.py Added reading 8-bit color images 2023-09-27 19:41:45 +10:00
test_file_eps.py Merge pull request #7392 from radarhere/eps 2023-10-05 09:27:06 -06:00
test_file_fits.py Remove FitsStubImagePlugin, deprecated in 9.1.0 2023-04-06 16:11:36 +03:00
test_file_fli.py Removed "del im" 2023-03-03 10:28:36 +02:00
test_file_fpx.py Close OleFileIO instance when closing or exiting FPX or MIC 2023-03-11 23:11:43 +11:00
test_file_ftex.py Remove constants deprecated in 9.1.0 2023-04-06 16:11:36 +03:00
test_file_gbr.py Improved consistency of returning an image access object from load() 2022-02-02 11:49:31 +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 Use "gray" more consistently 2023-10-19 19:12: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 Fix unclosed file warnings 2023-03-11 22:39:11 +11:00
test_file_hdf5stub.py Fix unclosed file warnings 2023-03-11 22:39:11 +11:00
test_file_icns.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_file_ico.py Fix up pytest.warns lambda: uses 2023-02-23 16:06:40 +02:00
test_file_im.py Removed "del im" 2023-03-03 10:28:36 +02:00
test_file_imt.py Added IMT tests 2022-09-29 08:22:01 +10:00
test_file_iptc.py Allow FotoStation tags 2023-08-22 10:13:41 +10:00
test_file_jpeg.py Allow configuring JPEG restart marker interval on save 2023-10-31 17:47:25 -05:00
test_file_jpeg2k.py Parametrized test 2023-07-22 20:15:40 +10: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 When orientation is applied, delete TIFF tag 2023-09-08 15:05:53 +10: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 Close OleFileIO instance when closing or exiting FPX or MIC 2023-03-11 23:11:43 +11:00
test_file_mpo.py Removed "del im" 2023-03-03 10:28:36 +02:00
test_file_msp.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_file_palm.py Combine if and assert statement 2023-10-19 20:34:28 +11:00
test_file_pcd.py Converted to pytest 2020-02-25 20:57:27 +11:00
test_file_pcx.py Parametrized tests 2022-10-03 16:57:42 +11:00
test_file_pdf.py Test for relevant characters before and after "SMask" 2023-08-07 20:49:29 +10:00
test_file_pixar.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_png.py Use "gray" more consistently 2023-10-19 19:12:01 +11:00
test_file_ppm.py Clear half token after use 2023-04-01 09:23:57 +11:00
test_file_psd.py Removed "del im" 2023-03-03 10:28:36 +02:00
test_file_qoi.py Use previous pixel alpha for QOI_OP_RGB 2023-08-31 09:27:33 +10:00
test_file_sgi.py Added test 2021-07-30 20:29:07 +10:00
test_file_spider.py Removed "del im" 2023-03-03 10:28:36 +02:00
test_file_sun.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_file_tar.py Fix up pytest.warns lambda: uses 2023-02-23 16:06:40 +02:00
test_file_tga.py Fix up pytest.warns lambda: uses 2023-02-23 16:06:40 +02:00
test_file_tiff_metadata.py Assert value instead of assigning unused variable 2023-02-24 21:01:03 +02:00
test_file_tiff.py Match warning message 2023-10-06 17:31:06 +11:00
test_file_wal.py Improved consistency of returning an image access object from load() 2022-02-02 11:49:31 +11:00
test_file_webp_alpha.py Assert that image is equal 2022-11-19 17:18:27 +11:00
test_file_webp_animated.py Round duration when saving animated WebP 2023-03-07 18:07:46 +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 Match warning message 2023-10-06 17:31:06 +11:00
test_file_webp.py Merge pull request #7420 from radarhere/transparency 2023-09-30 02:53:22 -06:00
test_file_wmf.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_file_xbm.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_file_xpm.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_file_xvthumb.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_font_bdf.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_font_crash.py Lint fixes 2023-01-01 07:03:09 +11:00
test_font_leaks.py Rename master to main 2021-10-15 17:30:05 +03:00
test_font_pcf_charsets.py Parametrized tests 2022-10-03 16:57:42 +11:00
test_font_pcf.py Removed ImageFont.getsize and related functions 2023-04-10 16:56:13 +10:00
test_format_hsv.py Added enums 2022-01-15 09:02:31 +11:00
test_format_lab.py Convert some tests to pytest style 2020-01-18 12:12:10 -08:00
test_image_access.py Merge branch 'main' into bgr 2023-10-06 18:50:25 +11:00
test_image_array.py Raise a warning if NumPy will not raise an error during conversion 2022-09-17 20:11:55 +10:00
test_image_convert.py Set C palette to be empty by default 2023-07-17 23:04:43 +10:00
test_image_copy.py Moved test to test_image_copy 2023-04-22 11:18:56 +10:00
test_image_crop.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_image_draft.py Streamline test skipping based on supported features 2020-02-18 13:07:01 -08:00
test_image_entropy.py Fixed bug with rounding pixels to palette 2022-06-18 04:09:41 -04:00
test_image_filter.py Improve efficiency when a radius is zero 2023-08-12 18:17:07 +10:00
test_image_frombytes.py Added memoryview support to frombytes() 2023-02-25 19:10:47 +11:00
test_image_fromqimage.py Deprecate support for Qt 5 (PyQt5 and PySide2). Use Qt 6 (PyQt6 or PySide6) instead. 2022-04-22 15:56:11 +03:00
test_image_getbands.py Convert some tests to pytest style 2020-01-18 12:12:10 -08:00
test_image_getbbox.py Updated tests now that alpha_only is keyword-only 2023-06-14 11:29:22 +10:00
test_image_getcolors.py Fixed bug with rounding pixels to palette 2022-06-18 04:09:41 -04:00
test_image_getdata.py Added enums 2022-01-15 09:02:31 +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 Updated tests in light of #6060 2022-02-20 23:54:12 +11:00
test_image_getprojection.py Convert various tests to pytest style 2020-01-27 22:46:52 +11:00
test_image_histogram.py Fixed bug with rounding pixels to palette 2022-06-18 04:09:41 -04:00
test_image_load.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_image_mode.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_image_paste.py make @pytest.mark.parametrize annotations one line 2022-08-22 13:29:26 -05:00
test_image_point.py Remove Image.coerce_e, deprecated in 9.2.0 2023-04-06 16:11:36 +03:00
test_image_putalpha.py Convert various tests to pytest style 2020-01-27 22:46:52 +11:00
test_image_putdata.py Support BGR;15, BGR;16 and BGR;24 in putdata 2023-07-26 20:09:40 +10:00
test_image_putpalette.py Set C palette to be empty by default 2023-07-17 23:04:43 +10:00
test_image_quantize.py Added test 2022-06-20 09:18:05 +10:00
test_image_reduce.py Parametrized tests 2022-10-03 16:57:42 +11:00
test_image_resample.py remove loop left from before parametrization 2023-01-07 19:16:06 +11:00
test_image_resize.py Further parametrizations 2022-08-24 10:37:40 +10:00
test_image_rotate.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_image_split.py Parametrized tests 2022-10-03 16:57:42 +11:00
test_image_thumbnail.py Do not call load() before draft() 2022-08-26 20:33:51 +10:00
test_image_tobitmap.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_image_tobytes.py Convert some tests to pytest style 2020-01-18 12:12:10 -08:00
test_image_transform.py sort colors before comparing them 2023-01-07 19:16:06 +11:00
test_image_transpose.py Parametrize tests 2022-08-23 21:41:32 +10:00
test_image.py Merge pull request #7289 from radarhere/undefined_palette 2023-10-05 09:31:02 -06:00
test_imagechops.py Use "gray" more consistently 2023-10-19 19:12:01 +11:00
test_imagecms.py Remove constants deprecated in 9.1.0 2023-04-06 16:11:36 +03:00
test_imagecolor.py Convert to HSV if mode is HSV in getcolor() 2023-06-22 23:27:45 +10:00
test_imagedraw.py Merge branch 'main' into load_default 2023-10-14 10:33:50 +11:00
test_imagedraw2.py Merge branch 'python-pillow:main' into test_lists_and_tuples 2023-04-13 00:20:44 -05:00
test_imageenhance.py Parametrized tests 2022-10-03 16:57:42 +11:00
test_imagefile.py Changed Image mode property to be read-only by default 2023-07-29 09:28:18 +10:00
test_imagefont.py Use "gray" more consistently 2023-10-19 19:12:01 +11:00
test_imagefontctl.py Fix up pytest.raises lambda: uses 2023-02-23 15:19:20 +02:00
test_imagefontpil.py Added size argument to load_default() 2023-08-26 17:01:01 +10:00
test_imagegrab.py Use tuple instead of list 2023-05-23 21:27:55 +10:00
test_imagemath.py Merge branch 'main' into main 2022-10-13 11:14:21 +02:00
test_imagemorph.py Parametrized tests 2022-10-03 16:57:42 +11:00
test_imageops_usm.py Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
test_imageops.py Test unsupported autocontrast mode 2023-10-24 12:44:00 +11:00
test_imagepalette.py Remove ImagePalette size parameter, deprecated in 8.4.0 2023-04-06 16:11:36 +03:00
test_imagepath.py Merge pull request #6904 from Yay295/imagepath_tests 2023-05-06 10:38:09 +10:00
test_imageqt.py Remove support for PyQt5 and PySide2, deprecated in 9.2.0 2023-04-06 16:11:36 +03:00
test_imagesequence.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_imageshow.py Remove ImageShow.Viewer.show_file file argument, deprecated in 9.1.0 2023-04-06 16:11:36 +03:00
test_imagestat.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_imagetk.py Remove PhotoImage.paste() box parameter, deprecated in 9.2.0 2023-04-06 16:11:36 +03:00
test_imagewin_pointers.py Only import ctypes as needed on Windows 2022-03-19 14:46:25 +11:00
test_imagewin.py Added memoryview support to Dib.frombytes() 2023-03-04 17:18:59 +11:00
test_lib_image.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_lib_pack.py Merge branch 'main' into bgr 2023-10-06 18:50:25 +11: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 Restored 32-bit support 2023-06-27 14:43:58 +10:00
test_mode_i16.py Merge branch 'main' into i16n 2023-03-13 14:33:26 +11:00
test_numpy.py Moved test to test_image_copy 2023-04-22 11:18:56 +10:00
test_pdfparser.py Use later value for duplicate xref entries 2023-04-20 23:15:20 +10:00
test_pickle.py Skip tests that require FreeType if FreeType is not available 2023-08-24 19:02:27 +10: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 Remove support for PyQt5 and PySide2, deprecated in 9.2.0 2023-04-06 16:11:36 +03:00
test_qt_image_toqimage.py Fix typo 2023-04-08 10:29:28 +03: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 [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00:00
test_uploader.py Converted to pytest 2020-02-25 20:57:27 +11:00
test_util.py [Private] class names should be CamelCase 2022-04-10 23:55:16 +03:00
test_webp_leaks.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2023-02-06 19:27:19 +00: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 pytest-timeout

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