Commit Graph

13 Commits

Author SHA1 Message Date
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
f87821e010 Format with Black 2019-06-13 18:54:11 +03:00
Andrew Murray
c96cdb5e77 Consistent DPI rounding 2019-03-30 15:03:57 +11: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
9e843a2d9b Changed format of lambda calls 2017-09-01 21:05:40 +10:00
Andrew Murray
371933a597 Added tests 2017-09-01 20:36:51 +10:00
Andrew Murray
37b293f593 Flake8 fixes 2017-04-20 21:14:23 +10:00
wiredfool
5071ea2a0e Merge pull request #2425 from radarhere/tests
Added tests
2017-03-03 15:44:33 +00:00
Andrew Murray
798fde57ca Removed unused imports 2017-03-03 21:38:19 +11:00
Andrew Murray
257bc8bd4f Added tests 2017-03-03 19:45:55 +11:00
wiredfool
5269828d3a Test: Relax WMF test condition, fixes #2323 2016-12-31 17:38:35 +00:00
glexey
0116c9240e EMF: support negative bounding box coordinates (#2249)
* EMF: support negative bounding box coordinates

Similar to placeable WMF, bounding box coordinates
should be interpreted as signed integer, otherwise
opening EMF file with negative (x0,y0) fails.

* Basic load tests for WMF and EMF formats

* WMF/WMF tests: just test open(), not load()

Not sure why load() fails on Debian build. Well, at least we can test
open().

* WMF/EMF: Unpack signed integers using unpack()

* WMF/EMF: Compare to reference PNG rendering

* EMF/WMF comparison: use assert_image_similar()

* Use similarity epsilon 0.5 for WMF, as vector rendering looks different across Windows platforms

* Trigger rebuild
2016-11-27 16:03:51 +00:00