Commit Graph

174 Commits

Author SHA1 Message Date
nulano
a0a5601689
Merge branch 'master' into gha-win 2019-10-08 12:56:43 +01:00
Jon Dufresne
64032061c0 Move several imports to the top-level of the file
This better follows PEP 8 style guide:

https://www.python.org/dev/peps/pep-0008/#imports

> Imports are always put at the top of the file, just after any module
> comments and docstrings, and before module globals and constants.

This also avoids duplicate import code within the same file.
2019-10-07 06:28:36 -07:00
Andrew Murray
d6ae0a99a7 Removed deprecated setting of TIFF image sizes 2019-10-03 22:12:28 +10:00
Andrew Murray
9a977b975c Raise error if dimension is a string 2019-09-30 18:48:10 +10:00
Andrew Murray
4de10089f0 Moved libtiff test into libtiff test file 2019-09-29 21:06:11 +10:00
nulano
cf1f8b0498 Tests.helper cleanup 2019-09-25 11:58:02 +02:00
Jon Dufresne
d50445ff30 Introduce isort to automate import ordering and formatting
Similar to the recent adoption of Black. isort is a Python utility to
sort imports alphabetically and automatically separate into sections. By
using isort, contributors can quickly and automatically conform to the
projects style without thinking. Just let the tool do it.

Uses the configuration recommended by the Black to avoid conflicts of
style.

Rewrite TestImageQt.test_deprecated to no rely on import order.
2019-07-06 16:11:35 -07:00
Andrew Murray
42588a6493 Skip test if libtiff is not installed 2019-06-30 13:26:58 +10:00
Andrew Murray
cc0d70145b Lint fixes 2019-06-30 13:26:58 +10:00
Christoph Gohlke
4a69223db9 Add test for sampleformat corruption 2019-06-30 13:26:58 +10:00
Hugo
f87821e010 Format with Black 2019-06-13 18:54:11 +03:00
Andrew Murray
e131fa22e2 Fixed reading and saving for TIFF and IM in PA mode 2019-05-11 14:43:48 +10:00
Hugo
05849ca794
Merge pull request #3714 from radarhere/tiff_frames
Improvements to TIFF is_animated and n_frames
2019-03-30 12:04:16 +02:00
Andrew Murray
c96cdb5e77 Consistent DPI rounding 2019-03-30 15:03:57 +11:00
Andrew Murray
d84fd20f0c Simplified is_animated 2019-03-28 08:13:47 +11:00
Andrew Murray
ab85290911 Fixed bug when seeking backwards and then forwards 2019-03-13 18:54:09 +11:00
Jon Dufresne
4de5477b61 Remove unnecessary unittest.main() boilerplate from test files
With the introduction and use of pytest, it is simple and easy to
execute specific tests in isolation through documented command line
arguments. Either by specifying the module path or through the `-k
EXPRESSION` argument. There is no longer any need to provide the
boilerplate:

    if __name__ == '__main__':
        unittest.main()

To every test file. It is simply noise.

The pattern remains in test files that aren't named with `test_*` as
those files are not discovered and executed by pytest by default.
2019-02-03 10:10:16 -08:00
Jon Dufresne
7da17ad41e Improve pytest configuration to allow specific tests as CLI args
The previous test configuration made it difficult to run a single test
with the pytest CLI. There were two major issues:

- The Tests directory was not a package. It now includes a __init__.py
  file and imports from other tests modules are done with relative
  imports.

- setup.cfg always specified the Tests directory. So even if a specific
  test were specified as a CLI arg, this configuration would also always
  include all tests. This configuration has been removed to allow
  specifying a single test on the command line.

Contributors can now run specific tests with a single command such as:

  $ tox -e py37 -- Tests/test_file_pdf.py::TestFilePdf.test_rgb

This makes it easy and faster to iterate on a single test failure and is
very familiar to those that have previously used tox and pytest.

When running tox or pytest with no arguments, they still discover and
runs all tests in the Tests directory.
2019-01-13 09:00:12 -08:00
Andrew Murray
71b64dcf73 Only close __fp if not fp 2019-01-04 12:29:23 +11:00
Andrew Murray
47775f3d50 Resolve __fp when closing and deleting 2018-11-17 21:56:06 +11:00
Hugo
ceebfc6fe8 flake8: E501 line too long 2018-11-11 19:01:11 +02:00
Hugo
619e5fde8d Remove unused local variables 2018-10-24 22:29:01 +03:00
Andrew Murray
929f7397db Line too long 2018-10-21 18:26:08 +11:00
Andrew Murray
6f44ae1d27 Only deprecate setting of TIFF image sizes 2018-09-30 15:08:35 +10:00
Hugo
d36365f4fb
Merge pull request #3227 from kkopachev/master
Adding support to reading tiled and YcbCr jpeg tiffs through libtiff
2018-09-29 19:45:29 +03:00
Andrew Murray
a8261a2e89 Line too long 2018-09-27 20:35:00 +10:00
Andrew Murray
f8fbac68de Removed unused imports 2018-09-27 20:31:01 +10:00
Konstantin Kopachev
98d88fd1c6
Add tests for uncompressed tiff with interleaved bands 2018-09-18 12:05:50 -07:00
Konstantin Kopachev
52637a4268
move libtiff-related tests into libtiff test file 2018-09-18 12:05:50 -07:00
Konstantin Kopachev
1f63abdba8
Fix tiled raw tiff read and add tests 2018-09-18 12:05:49 -07:00
Jon Dufresne
875e8c4bda Avoid catching unexpected exceptions in tests
Instead, allow exceptions to bubble up to the unittest exception
handler.

Prevents replacing the exception trace with a less informative
message. As the exceptions are always unexpected, should not need to
catch them explicitly in tests.
2018-09-04 19:43:20 -07:00
Andrew Murray
c2189235af Line too long 2018-07-02 19:26:02 +10:00
Andrew Murray
9a3d554c1d Changed Exception tests to be more specific 2018-06-12 04:41:31 +10:00
Andrew Murray
5ef5a3c9b2 Corrected test 2018-06-06 22:34:09 +10:00
Andrew Murray
b4e6cdadac Added py3 variable to _util 2018-04-20 09:19:13 +10:00
Andrew Murray
c13ccf13a1 Added missing whitespace 2018-03-06 19:53:07 +11:00
Andrew Murray
2202196162 Flake8 blank line fixes 2018-03-04 21:36:33 +11:00
Andrew Murray
30b2ddd070 Removed duplicate imports 2018-01-04 15:40:46 +11:00
Eric Soroos
e617d05b9e These tests/features now require libtiff 2017-12-20 12:22:28 +00:00
Eric Soroos
4877552581 Read all compressed files through libtiff. 2017-12-20 11:55:40 +00:00
Eric Soroos
bec8f415be end to end test helper, more end to end tests for tiffs 2017-12-20 11:55:40 +00:00
Tomasz Jezierski
bc6683cecf tiff-colors-fix test adjust 2017-12-20 11:54:26 +00:00
wiredfool
9ed4ea9e47
Merge pull request #2883 from uploadcare/tiff-wrong-bitspersample
Fix count of BITSPERSAMPLE items in broken TIFF files
2017-12-09 14:32:47 +00:00
Alexander
ce151bcd72 add test for this case 2017-12-08 17:32:39 +03:00
Andrew Murray
bc255c97ff Added support for generators when using append_images 2017-11-04 10:46:15 +11:00
Andrew Murray
f61b70aa8f Changed EOFError tests 2017-09-30 13:33:06 +10:00
Andrew Murray
78c62727d3 Moved seek frame position check into ImageFile 2017-09-30 13:32:43 +10:00
wiredfool
fd8ee8437b Merge pull request #2315 from radarhere/is_animated
If n_frames is known, then use when determining is_animated
2017-09-29 15:26:22 +01:00
Eric Soroos
a89c4e455d Target mode is I, check pixels 2017-09-20 09:26:40 +00:00
Andrew Murray
4087479464 Added test image 2017-09-20 09:04:48 +00:00