Commit Graph

20 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
2389492f96
flake8 2018-09-26 14:09:31 +03:00
dinko
66207b47bc fix _crop and tests 2018-09-05 21:00:35 +02: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
wiredfool
97ee3dd12b
Merge pull request #2583 from wiredfool/decompression_bomb_error
Decompression bomb error
2017-12-20 20:31:38 +00:00
Andrew Murray
9e843a2d9b Changed format of lambda calls 2017-09-01 21:05:40 +10:00
wiredfool
544f76b102 Adjust test so that we get warning, not error 2017-06-21 04:04:27 -07:00
wiredfool
1a1a2ed001 Added DecompressionBombError on 2 x pixels of warning, ref #2410 2017-06-21 03:54:48 -07:00
wiredfool
c70977aad7 added decompression bomb check to crop 2017-06-21 02:36:11 -07:00
Andrew Murray
e8cba27bb1 Changed assert checks to more specific versions 2017-06-03 14:04:54 +10:00
homm
1ba4e9e5ba remove end of file banner from all files 2016-07-10 14:11:28 +03:00
hugovk
b929873a62 Change some lena() to hopper() 2014-09-05 12:36:24 +03:00
hugovk
cf04a9a0d2 Remove unused tearDownModule 2014-07-07 20:03:50 +03:00
Alex Clark
2ccd76e66f Fix path 2014-06-23 14:38:03 -04:00
hugovk
282281f1e5 Reset limit in tearDown() 2014-06-23 11:22:25 +03:00
hugovk
7b3e242f09 Convert test_decompression_bomb.py to use unittest module 2014-06-23 11:12:41 +03:00
hugovk
46abe78b77 Use a custom subclass of RuntimeWarning for DecompressionBombWarning 2014-06-23 10:53:08 +03:00
hugovk
fd05e9c756 Test decompression bomb warnings 2014-05-27 12:40:52 +03:00