Commit Graph

58 Commits

Author SHA1 Message Date
Andrew Murray
4ce06aac3b Added type hints 2024-02-12 23:01:44 +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
Aarni Koskela
5c8a9165ab Fix up pytest.raises lambda: uses 2023-02-23 15:19:20 +02:00
nulano
e2158344a0
update test_imagefont to use textbbox 2022-06-20 01:20:56 +01:00
Hugo van Kemenade
606b5ae1e5 Remove support for FreeType 2.7 and older 2021-10-18 09:29:53 +03:00
Hugo van Kemenade
a95fee0475
Merge pull request #5215 from radarhere/license
Document license for several fonts
2021-03-07 11:41:56 +02:00
Andrew Murray
3495b319bd Replaced various instances of assert_image_similar with assert_image_similar_tofile 2021-02-21 22:22:29 +11:00
Andrew Murray
b39977e1c2 Document license for several fonts 2021-01-21 21:33:35 +11:00
mergify[bot]
50787ad2c4
Merge pull request #4971 from radarhere/freetype
Updated freetype to 2.10.3
2020-10-13 06:10:01 +00:00
nulano
cb3f6c09e7 add spaces between pytest.mark.parametrize parameters 2020-10-12 16:08:16 +01:00
nulano
90e8255ba4 Merge remote-tracking branch 'upstream/master' into anchor-part3
# Conflicts:
#	Tests/test_imagefontctl.py
2020-10-12 15:50:45 +01:00
nulano
b5fe0e7986 add helper.skip_unless_feature_version 2020-10-11 22:26:11 +01:00
Andrew Murray
166cc00843 Updated freetype to 2.10.3 2020-10-11 21:35:21 +11:00
nulano
1551e120ae add textlength and textbbox to ImageDraw 2020-10-09 01:02:51 +01:00
nulano
395aa946a9 add getbbox and getlength, with tests
Squashed commits:

[ec9ec31b] add tests for invalid anchor
(cherry picked from commit 9e50a6a47f79876ee56942152047f03fff03c49b)

[386a9170] fix lint and docs
(cherry picked from commit 2d0d5282fcfc3ee332a41e60b865ee766445cc3d)

[29f5d4c9] restore and document previous getsize behaviour
see discussion in issue 4789
(cherry picked from commit 9fbc94571ce0ed42fdd11e99f343a1613c9dc6d3)

[0ffd51a0] add getbbox and getlength, with tests
(cherry picked from commit c5f63737476a998c81e589e5819d21ca69bb7b46)
2020-10-09 00:56:58 +01:00
nulano
7d284b72ab
f-strings!
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2020-09-22 22:19:04 +01:00
nulano
3fc1be06e6 add and fix tests for text anchors 2020-09-22 11:31:43 +02:00
Hugo van Kemenade
dd87dd50c0 Update to isort 5 with Black profile support 2020-08-08 22:39:29 +03:00
nulano
d2f90d6cac fix freetype and raqm on MSYS 2020-05-23 23:16:06 +02:00
Andrew Murray
7ff2db143d Removed use of PillowTestCase 2020-03-23 07:05:51 +11:00
Andrew Murray
8482919a37 Converted most assert statements to pytest 2020-02-23 00:06:21 +11:00
Jon Dufresne
4f185329f4 Streamline test skipping based on supported features
This adds a new test decorator: skip_unless_feature(). The argument is
the same as passed to features.check(). If the feature is not supported,
the test will be skipped.

This removes several kinds of boilerplate copied and pasted around tests
so test feature checking is handled and displayed more consistently.

Refs #4193
2020-02-18 13:07:01 -08:00
Hugo
a4bf9fa036 Convert most PillowTestCase methods to pytest 2020-02-02 12:26:01 +02:00
Andrew Murray
c0048ad7de Use context managers 2019-11-26 07:03:23 +11: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
Andrew Murray
f93a5d0972 Added text stroking 2019-07-29 06:40:03 +10: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
68fac40147 Fixed black formatting 2019-06-22 14:47:56 +10:00
Hugo
f5cd8b4b0d
Merge pull request #3909 from hugovk/run-black
Format code with Black
2019-06-22 06:46:15 +03:00
Andrew Murray
ea0f1c6b06 Do not presume that the last glyph has the max x value 2019-06-19 22:32:01 +10:00
Hugo
488a0170a3 Format with Black 2019-06-19 09:30:10 +03:00
Hugo
1b99362f3d Merge remote-tracking branch 'upstream/master' into run-black 2019-06-19 09:29:28 +03:00
Hugo
5631718a8d Format with Black 2019-06-13 18:54:46 +03:00
Andrew Murray
54c83f61bd Check for raqm version function 2019-06-07 05:51:40 +10:00
Andrew Murray
1c1447f563 Corrected ttb text positioning 2019-06-07 05:51:40 +10:00
Andrew Murray
b742d1511e Fixed raqm layout bug 2019-04-11 15:36:33 +10:00
Ben Yang
7324a32443 fixed some whitespace to pass linting 2019-03-11 18:56:22 -07:00
Ben Yang
8624efd283 added ability to set language for text rendering 2019-03-11 18:55:46 -07: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
c2189235af Line too long 2018-07-02 19:26:02 +10:00
Andrew Murray
e7815ccd62 Block comment should start with '# ' 2018-07-02 19:21:44 +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
Metallicow
5e94cd0fc2 Trim trailing whitespace tests dir 2018-01-27 00:07:24 -06:00
wiredfool
2c6cf03de1 test features in get size 2017-06-30 22:57:57 +01:00
wiredfool
14293ea4b1 Tests pass on osx 2017-06-29 01:50:29 -07:00