Commit Graph

61 Commits

Author SHA1 Message Date
Andrew Murray
72b7ab54bd pre-commit autoupdate --freeze 2022-03-04 16:42:24 +11:00
Andrew Murray
a1412681ff Added specific error messages when ink has incorrect number of bands 2021-05-19 20:19:57 +10:00
Andrew Murray
7b4b356fc0 Test for incorrect PixelAccess arguments 2021-01-14 22:09:11 +11:00
Andrew Murray
bdbf1694fc Allow PixelAccess to use Python __int__ when parsing x and y 2021-01-14 21:31:25 +11:00
Andrew Murray
b304a13bca Updated test 2020-09-22 13:06:52 +10:00
Andrew Murray
27c0747518 Allow tuples with one item to give single color value in getink 2020-09-20 14:23:05 +10:00
Hugo van Kemenade
799fa9764f
Merge pull request #4882 from nulano/putpixel 2020-09-03 19:22:30 +03:00
Hugo van Kemenade
e0eec1eb56 Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
nulano
4b2a0173d3 group test cases
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2020-08-21 14:11:47 +02:00
nulano
76a51270fa split up test 2020-08-20 23:23:15 +02:00
nulano
4bb78d53a3 give proper error message for invalid putpixel color type 2020-08-20 00:01:03 +02:00
Hugo van Kemenade
dd87dd50c0 Update to isort 5 with Black profile support 2020-08-08 22:39:29 +03:00
Hugo van Kemenade
10615a7da7 Upgrade Python syntax for 3.6+
Co-authored-by: nulano <nulano@nulano.eu>
2020-07-30 10:09:18 +03:00
Andrew Murray
a10634e13f Do not explicitly import distutils 2020-07-26 14:59:30 +10:00
Andrew Murray
42bb401e88 Replaced distutils sysconfig 2020-07-25 20:03:27 +10:00
Andrew Murray
76734573f0 Converted setup and teardown methods 2020-03-04 21:31:50 +11:00
Hugo
2cc6a9a974 Convert to use pytest 2020-03-02 16:31:08 +02:00
Hugo
699a9dadf1 Convert asserts 2020-02-22 18:07:04 +02:00
Andrew Murray
8482919a37 Converted most assert statements to pytest 2020-02-23 00:06:21 +11:00
Hugo
a4bf9fa036 Convert most PillowTestCase methods to pytest 2020-02-02 12:26:01 +02:00
Jon Dufresne
33dabf986f Import unittest from stdlib rather than helper.py
The unittest in helper.py has not offered an interesting abstraction
since dbe9f85c7d so import from the more
typical stdlib location.
2019-11-20 18:42:52 -08:00
Andrew Murray
4140cd807b
Merge branch 'master' into rm-2.7 2019-10-12 18:03:58 +11:00
nulano
a0a5601689
Merge branch 'master' into gha-win 2019-10-08 12:56:43 +01:00
Andrew Murray
6cd99fc3cf
Merge branch 'master' into rm-2.7 2019-10-08 18:57:27 +11: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
Hugo
538d9e2e5d Upgrade Python syntax with pyupgrade --py3-plus 2019-10-07 14:30:59 +03:00
Hugo
af770a6c55 Drop support for EOL Python 2.7 2019-10-07 14:30:59 +03:00
nulano
cf1f8b0498 Tests.helper cleanup 2019-09-25 11:58:02 +02:00
nulano
4d35cb9d0a test-windows.yml pypy3, use actions/setup-python 2019-09-25 09:17:38 +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
Hugo
77f946d8bc Format with Black 2019-06-13 18:54:24 +03: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
Hugo
1885a2cef5
Merge pull request #3579 from jdufresne/run-one-test
Improve pytest configuration to allow specific tests as CLI args
2019-02-03 11:30:57 +02:00
Hugo
d6055440d5 Drop support for EOL Python 3.4 2019-01-24 23:33:14 +02: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
671f7a392d Allow RGBA value for P image putpixel 2018-12-31 13:37:04 +11:00
Andrew Murray
3f6282e259 Allow RGB value for P image putpixel 2018-12-31 11:35:15 +11:00
Hugo
a568a8730e flake8: E302 expected 2 blank lines, found 1 2018-11-11 19:01:11 +02:00
Nazime
63a0b801b4 misspelled variable name 2018-10-15 13:06:08 +02:00
Nazime
86324a842d Add setting negative pixels and unittest 2018-10-15 12:51:24 +02:00
Hugo
847581f7dd Remove redundant 'pass' 2018-08-25 19:06:11 +03:00
Hugo
663b06e223 Skip: CFFI imports pycparser which doesn't support PYTHONOPTIMIZE=2 2018-08-25 19:06:11 +03:00
Hugo
4218a769d7 Refactor cffi import and skipping 2018-08-25 19:06:11 +03:00
Andrew Murray
c2189235af Line too long 2018-07-02 19:26:02 +10:00
Andrew Murray
cbc056f43d Fixed whitespace 2018-04-18 16:00:57 +10:00
Andrew Murray
2202196162 Flake8 blank line fixes 2018-03-04 21:36:33 +11:00
Andrew Murray
62b2bdf909 Removed unused imports 2018-01-04 14:56:18 +11:00
hugovk
5592163564 pytest no longer supports EOL Python 3.3 2017-12-28 14:48:19 +00:00
Andrew Murray
37b293f593 Flake8 fixes 2017-04-20 21:14:23 +10:00
wiredfool
fe0a33173b Give up on appveyor for now, disable test 2017-04-03 11:47:20 -07:00