Commit Graph

55 Commits

Author SHA1 Message Date
Andrew Murray
4ce06aac3b Added type hints 2024-02-12 23:01:44 +11:00
Andrew Murray
cdc498e6f3 Added type hints 2024-02-07 19:16:28 +11:00
Hugo van Kemenade
4a4b90c365
Autotype tests (#7756)
* autotyping: --none-return
* autotyping: --scalar-return
* autotyping: --int-param
* autotyping: --float-param
* autotyping: --str-param
* autotyping: --annotate-named-param tmp_path:pathlib.Path
2024-01-31 20:12:58 +11:00
Hugo van Kemenade
53c3cd9f8e isort Tests 2024-01-20 13:23:03 +02:00
Hugo van Kemenade
43b2f61e79 Add 'from __future__ import annotations' using Ruff/isort 2023-12-21 13:13:31 +02:00
Andrew Murray
bcded33cee
Merge pull request #6195 from hugovk/cleanup
Cleanup: various
2022-04-26 18:51:44 +10:00
Andrew Murray
5d4258e72b Simplified index slicing 2022-04-25 22:52:29 +10:00
Hugo van Kemenade
d3c9a6504e Variable in function should be snake_case 2022-04-10 23:55:16 +03:00
Andrew Murray
f8e4e9c2dd Added enums 2022-01-15 09:02:31 +11:00
Hugo van Kemenade
dd87dd50c0 Update to isort 5 with Black profile support 2020-08-08 22:39:29 +03:00
Hugo
44e661f25a Convert to use pytest 2020-02-22 23:03:01 +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
63729766c4 Remove unnecessary coerce to float
In Python 3, the division operator is floating point division. No longer
need to coerce integers to floating point numbers before division.
2020-01-26 06:33:18 -08: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
Hugo
538d9e2e5d Upgrade Python syntax with pyupgrade --py3-plus 2019-10-07 14:30:59 +03: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
d08475442b Format with Black 2019-06-13 18:53:42 +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
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
Hugo
bac99bd5ae Add assert for previously unused 'lut' variable 2018-10-24 22:29:01 +03:00
Andrew Murray
9b0d4baa8c Continuation line under-indented for visual indent 2018-09-27 20:31:01 +10:00
Andrew Murray
c2189235af Line too long 2018-07-02 19:26:02 +10:00
Andrew Murray
0832f9c58b Continuation line unaligned for hanging indent 2018-07-02 19:21:44 +10:00
Andrew Murray
c19d77abed Continuation line under-indented for visual indent 2018-07-02 19:21:44 +10:00
Alexander
33c0b5df21 use assertRaisesRegex 2018-04-15 23:35:41 +03:00
Alexander
c6f5077afc Merge branch 'master' into lut-numpy 2018-04-15 23:30:40 +03:00
Alexander
497e9d8251 full buffer support 2018-04-15 00:33:15 +03:00
Hugo
ecc4c7fecc Remove unittest regex deprecation warnings 2018-04-14 21:54:40 +03:00
Alexander
63b243e1f6 color lut numpy tests 2018-04-14 19:17:15 +03:00
Alexander Karpinsky
b01ba0f50c
Merge pull request #3091 from uploadcare/lut-alter
Transforming LUTs
2018-04-14 18:08:52 +03:00
Alexander
a325559f58 One more test for coverage 2018-04-14 17:47:53 +03:00
Alexander
eae14c56e1 Check exception type only, not string 2018-04-14 17:22:21 +03:00
Alexander
aba478abba Raise error if it is occurred during conversion in getlist 2018-04-14 17:13:05 +03:00
Alexander
daa8e7dacd Add earlier catching of wrong channels count 2018-04-12 12:40:40 +03:00
Alexander
75c76d91e1 Add repr for Color3DLUT 2018-04-12 11:54:54 +03:00
Alexander
fb1d25417e test for wrong channels number in generate 2018-04-11 20:55:35 +03:00
Alexander
ecd0e5e15e check exception type only 2018-04-11 17:31:41 +03:00
Alexander
acfd4845c6 tests 2018-04-11 17:05:48 +03:00
Alexander
70c453b857 rename alter() to transform()
add with_normals argument
docstring
2018-04-11 16:17:10 +03:00
Alexander
4231038132 Remove unused imports 2018-04-01 19:52:39 +03:00
Alexander
912980c52f Remove Color3DLUT.from_cube_file from сore library 2018-03-31 19:56:09 +03:00
Alexander
805dc44707 improve color cube parser 2018-03-30 11:29:59 +03:00
Alexander
c1b956e3c8 More tests fixes for windows 2018-03-30 10:21:01 +03:00
Alexander
83a5f6e5b5 change file mode 2018-03-30 10:09:22 +03:00
Alexander
e304a0d501 add tests, fix error messages 2018-03-30 09:57:54 +03:00
Alexander
aa929dda98 from_cube_file + test 2018-03-30 02:02:37 +03:00
Alexander
d2a5d1e44d Add tests for some cases and fix bugs 2018-03-29 23:56:51 +03:00
Alexander
622749530b Color3DLUT.generate 2018-03-29 17:26:21 +03:00