Commit Graph

22 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
40c6e4f136 Do not play sound when running screencapture command 2018-11-08 06:05:45 +11:00
Andrew Murray
bd9cfb124b Added ImageGrab.grabclipboard test 2018-10-22 18:55:16 +11:00
Andrew Murray
467d2089be Enabled ImageGrab.grab test on AppVeyor 2018-10-22 18:39:07 +11:00
Andrew Murray
88fdf504b3 Removed duplicate test 2018-07-21 14:38:47 +10:00
Andrew Murray
803cdf068f Removed unnecessary parameter 2017-06-03 13:56:23 +10:00
Andrew Murray
b58f76dc4f Renamed references to OS X to macOS 2016-09-23 21:12:03 +10:00
homm
1ba4e9e5ba remove end of file banner from all files 2016-07-10 14:11:28 +03:00
Andrew Murray
7c0554c74e Added support for ImageGrab.grab to OS X 2015-08-01 17:44:13 +10:00
wiredfool
2605f27bd3 Find all the function names 2015-06-16 14:08:10 -07:00
wiredfool
1086ba9e6e Function rename 2015-06-16 13:35:34 -07:00
wiredfool
87d5c8a506 added explanation 2015-06-12 10:17:04 -07:00
wiredfool
0347bcc91d Tests that faill on appveyor CI, but pass on a real machine 2015-06-12 09:56:12 -07:00
Hugo
e5a068de53 Yet another Python 3 fix 2014-09-16 17:41:03 +03:00
Hugo
311a0c6f68 Another Python 3 fix 2014-09-16 17:19:15 +03:00
Hugo
300a3f0e70 Fix for Python 3 2014-09-16 16:44:51 +03:00
Hugo
99887a5467 Improve the error message when importing ImageGrab on non-Windows (#901) 2014-09-16 16:05:22 +03:00
hugovk
0c12058e37 Use unique class names to match filenames 2014-07-20 01:17:20 +03:00
hugovk
cf04a9a0d2 Remove unused tearDownModule 2014-07-07 20:03:50 +03:00
hugovk
3ec505958e Convert old tests to use unittest 2014-06-10 12:10:47 +03:00
Brian Crowell
ad784eb808 py3k: Import Christoph Gohlke's test suite
This is Christoph Gohlke's test suite from his personal PIL package found
at http://www.lfd.uci.edu/~gohlke/pythonlibs/.

This is just to bring it in as a separate commit. Future commits will align
it with Pillow.
2013-01-10 08:46:39 -06:00