Commit Graph

16 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
9e843a2d9b Changed format of lambda calls 2017-09-01 21:05:40 +10:00
Hugo
1242b77872 Fix typos 2017-03-13 07:58:24 +02:00
homm
1ba4e9e5ba remove end of file banner from all files 2016-07-10 14:11:28 +03:00
Andrew Murray
309ab1fc3d Various Flake8 fixes 2015-07-03 16:22:56 +10:00
Andrew Murray
a06b59bd52 Added various tests 2015-07-03 15:03:25 +10:00
Andrew Murray
d1c182cadc Various Flake8 fixes 2015-04-24 09:26:52 +10:00
Hugo
c793323cbc Replace lena.xpm with hopper.xpm 2014-09-23 16:01:58 +03:00
wiredfool
d30eb007ef Fix scrambled XPM image, don't mmap when load_read/load_seek is defined. Fixes #806 2014-07-18 10:40:08 -07:00
hugovk
14d1ac6389 Rename bad variable name 'file' to 'TEST_FILE', remove unused 'data' variable 2014-07-17 23:23:50 +03:00
hugovk
665293e9b9 More tests for XpmImagePlugin.py 2014-07-17 02:38:57 +03:00
hugovk
cf04a9a0d2 Remove unused tearDownModule 2014-07-07 20:03:50 +03:00
hugovk
78003ca473 Update paths to Tests/images/ instead of Images/ 2014-06-23 09:19:29 +03:00
hugovk
3ec505958e Convert old tests to use unittest 2014-06-10 12:10:47 +03:00
Brian Crowell
276cc421f7 py3k: Add XPM read test
This test includes an XPM file with transparency.
2013-01-10 08:47:03 -06:00