Commit Graph

13 Commits

Author SHA1 Message Date
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
fc3a159c87 More specific exception clause 2018-10-24 22:29:01 +03:00
Hugo
cfc4c3e101 Switch check_ to test_ to enable them 2018-10-21 16:44:12 +03:00
Hugo
a1b9f94d60 skipUnless takes a condition and _reason_ 2018-10-21 16:42:41 +03:00
Jason Douglas
c18d26b04b - Conditonally compile animation support, only if the mux.h and demux.h headers meet the ABI version requirements
- Add WEBPMUX support back to WebPDecode_wrapper (to support older versions of libwebp that have mux support, but not animation)
- Add HAVE_WEBPANIM flag, and use it appropriately
- Update documentation / tests
2017-09-27 19:04:24 -07:00
Andrew Murray
9e843a2d9b Changed format of lambda calls 2017-09-01 21:05:40 +10:00
Eric Soroos
3293d6a1c5 tests for features 2017-06-13 04:38:26 -07:00
Andrew Murray
e8cba27bb1 Changed assert checks to more specific versions 2017-06-03 14:04:54 +10:00
Jon Dufresne
e44bb42ae9 Replace type() equality checks with isinstance 2016-10-31 06:41:43 -07:00
homm
1ba4e9e5ba remove end of file banner from all files 2016-07-10 14:11:28 +03:00
hugovk
05987c8d60 Test unsupported features 2015-05-15 11:42:36 +03:00
Andrew Murray
3458e7a4c3 Added feature checking tests 2015-05-15 07:33:17 +10:00