Commit Graph

11 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
Andrew Murray
4a781d0013 Replaced MacOS with macOS 2018-03-19 19:38:17 +11:00
homm
1ba4e9e5ba remove end of file banner from all files 2016-07-10 14:11:28 +03:00
hugovk
1de128d6b6 Merge branch 'master' into flake8 2014-09-14 10:23:51 +03:00
Hugo
d7f7965aa2 Replace lena.gif with hopper.gif 2014-09-04 08:44:46 +03:00
hugovk
1335006cd7 flake8 2014-08-28 14:44:19 +03:00
hugovk
cf04a9a0d2 Remove unused tearDownModule 2014-07-07 20:03:50 +03:00
Michael Brown
fb27befa1a Skip shell injection tests for Windows 2014-06-30 22:07:44 -04:00
Michael Brown
8b365f542a Skip tests if external commands aren't found 2014-06-27 19:11:01 -04:00
Michael Brown
d283f77884 Tests for _save_netpbm, _save_cjpeg and load_djpeg 2014-06-27 19:07:20 -04:00