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.
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.
* 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