Commit Graph

36 Commits

Author SHA1 Message Date
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
wiredfool
db2359a30f y offset on trusty/x86 is 1.63 2017-06-21 14:00:15 -07:00
Eric Soroos
53e247cfc4 test tweak for ubuntu 16.04 2017-06-21 14:00:15 -07:00
wiredfool
f371ca07f4 hoist tests out of try/except, use feature detection 2017-06-21 14:00:15 -07:00
Fahad Al-Saidi
e07a254ed9 update 2017-06-21 14:00:14 -07:00
Fahad Al-Saidi
fd7a675de6 adding KeyError exception
so the test not fail when there is no raqm lib.
2017-06-21 14:00:14 -07:00
Fahad Al-Saidi
4ed6962364 only catch ImportError same as test_imagefont.py 2017-06-21 14:00:14 -07:00
shamsa
312c87e279 fix testing 2017-06-21 14:00:14 -07:00
shamsa
fcd20da3cb Testing complex text layout. 2017-06-21 14:00:14 -07:00