Commit Graph

50 Commits

Author SHA1 Message Date
Andrew Murray
4814bee6c0 Use Path instead of PosixPath 2024-01-23 21:42:36 +11:00
Andrew Murray
a09e056a4c Added type hints 2024-01-22 18:42:43 +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
b2301d70d1 Removed ImageFont.getsize and related functions 2023-04-10 16:56:13 +10:00
nulano
74e0b954f2
test {ImageFont,TransposedFont}.getsize() deprecation 2022-07-01 11:22:47 +02:00
Andrew Murray
0d91d13a6e Merge branch 'main' into deprecate-getsize 2022-06-30 20:37:37 +10:00
Andrew Murray
93805d5257 Limit expected number of characters to nencoding 2022-06-27 14:05:13 +10:00
nulano
f34a6460ef
update test_font_pcf to use getbbox 2022-06-19 22:04:56 +01: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
a5c251029c Replaced various instances of assert_image_equal with assert_image_equal_tofile 2021-02-21 22:15:56 +11:00
Hugo van Kemenade
dd87dd50c0 Update to isort 5 with Black profile support 2020-08-08 22:39:29 +03:00
Andrew Murray
ec9015bea4
Renamed variable
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2020-06-06 19:42:24 +10:00
Andrew Murray
e228cfcec7 Lint fixes 2020-06-06 12:08:37 +10:00
Andrew Murray
b602f365ae Removed PillowTestCase helper class 2020-03-28 12:51:28 +11:00
Andrew Murray
a8637449b9 Converted common Qt test classes 2020-03-28 12:21:00 +11:00
Andrew Murray
748739c992 Converted addCleanup 2020-03-28 12:20:56 +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
Hugo
af770a6c55 Drop support for EOL Python 2.7 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
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
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
04a1f71b4c
Merge pull request #3105 from radarhere/py3
Change Python version checks to use util
2018-04-22 18:37:33 +03:00
Andrew Murray
b4e6cdadac Added py3 variable to _util 2018-04-20 09:19:13 +10:00
Andrew Murray
b560f5b417 Changed Python version checks in tests to use helper 2018-04-19 19:40:56 +10:00
Andrew Murray
37f5f1120a Fixed block comments 2018-04-18 16:00:57 +10:00
Andrew Murray
cbc056f43d Fixed whitespace 2018-04-18 16:00:57 +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
Eric Soroos
b0b2009c58 Where is this failing on hello, world 2017-11-02 13:07:49 +00:00
Eric Soroos
ab61cedbdc added text size test 2017-11-02 13:07:49 +00:00
Eric Soroos
ebb0a491b6 test the accuracy of the font file conversion 2017-11-02 13:07:49 +00:00
Eric Soroos
7a5d215022 Remove Adobe Helvetica screen font, update Pcf font tests using freely available font 2017-11-02 13:07:49 +00:00
Andrew Murray
9e843a2d9b Changed format of lambda calls 2017-09-01 21:05:40 +10:00
Andrew Murray
c10ad19a2b Changed file opening in tests to use with 2017-09-01 20:03:54 +10:00
Jon Dufresne
ffa5bc2726 Use generator expressions instead of list comprehension
Avoids unnecessary temporary lists in memory.
2016-11-14 18:11:15 -08:00
homm
1ba4e9e5ba remove end of file banner from all files 2016-07-10 14:11:28 +03:00
Andrew Murray
a06b59bd52 Added various tests 2015-07-03 15:03:25 +10:00
Andrew Murray
ee34d6843b Further health fixes 2015-04-24 18:24:52 +10:00
hugovk
cf04a9a0d2 Remove unused tearDownModule 2014-07-07 20:03:50 +03:00
wiredfool
c824a15fe8 Thread and race condition safe tempfiles for testing 2014-06-30 15:22:36 -07:00
hugovk
3ec505958e Convert old tests to use unittest 2014-06-10 12:10:47 +03:00
wiredfool
540e1e2c68 Added ability to render a bytes object using an old style bitmap font to make it easier to use in Py3k 2014-02-04 21:41:16 -08:00
wiredfool
4d32136365 Working in py3k, not in 2.x 2014-02-04 21:41:16 -08:00
Michał Górny
a83530f475 test_font_pcf: skip if zlib is not available. 2013-04-21 10:30:59 +02:00
Brian Crowell
ad784eb808 py3k: Import Christoph Gohlke's test suite
This is Christoph Gohlke's test suite from his personal PIL package found
at http://www.lfd.uci.edu/~gohlke/pythonlibs/.

This is just to bring it in as a separate commit. Future commits will align
it with Pillow.
2013-01-10 08:46:39 -06:00