Skip to content

Commit 7be0270

Browse files
committed
Updated README.rst and remove pillow as a dependency
1 parent 4f860ec commit 7be0270

File tree

2 files changed

+17
-39
lines changed

2 files changed

+17
-39
lines changed

README.rst

Lines changed: 17 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ About
66
This is a plugin to facilitate image comparison for
77
`Matplotlib <http://www.matplotlib.org>`__ figures in pytest.
88

9-
Matplotlib includes a number of test utilities and decorators, but these
10-
are geared towards the `nose <http://nose.readthedocs.org/>`__ testing
11-
framework. Pytest-mpl makes it easy to compare figures produced by tests
12-
to reference images when using `pytest <http://pytest.org>`__.
13-
149
For each figure to test, the reference image is subtracted from the
1510
generated image, and the RMS of the residual is compared to a
1611
user-specified tolerance. If the residual is too large, the test will
@@ -23,23 +18,17 @@ section below.
2318
Installing
2419
----------
2520

26-
This plugin is compatible with Python 2.6, 2.7, and 3.3 and later, and
27-
requires `pytest <http://pytest.org>`__,
28-
`matplotlib <http://www.matplotlib.org>`__ and
29-
`nose <http://nose.readthedocs.org/>`__ to be installed (nose is
30-
required by Matplotlib).
31-
32-
To install, you can do:
21+
This plugin is compatible with Python 2.7, and 3.5 and later, and
22+
requires `pytest <http://pytest.org>`__ and
23+
`matplotlib <http://www.matplotlib.org>` to be installed.
3324

34-
::
25+
To install, you can do::
3526

3627
pip install pytest-mpl
3728

38-
You can check that the plugin is registered with pytest by doing:
39-
40-
::
29+
You can check that the plugin is registered with pytest by doing::
4130

42-
py.test --version
31+
pytest --version
4332

4433
which will show a list of plugins:
4534

@@ -71,24 +60,20 @@ function returns a Matplotlib figure (or any figure object that has a
7160
7261
To generate the baseline images, run the tests with the
7362
``--mpl-generate-path`` option with the name of the directory where the
74-
generated images should be placed:
75-
76-
::
63+
generated images should be placed::
7764

78-
py.test --mpl-generate-path=baseline
65+
pytest --mpl-generate-path=baseline
7966

8067
If the directory does not exist, it will be created. The directory will
81-
be interpreted as being relative to where you are running ``py.test``.
68+
be interpreted as being relative to where you are running ``pytest``.
8269
Once you are happy with the generated images, you should move them to a
8370
sub-directory called ``baseline`` relative to the test files (this name
8471
is configurable, see below). You can also generate the baseline images
8572
directly in the right directory.
8673

87-
You can then run the tests simply with:
74+
You can then run the tests simply with::
8875

89-
::
90-
91-
py.test --mpl
76+
pytest --mpl
9277

9378
and the tests will pass if the images are the same. If you omit the
9479
``--mpl`` option, the tests will run but will only check that the code
@@ -145,11 +130,9 @@ a comma-separated list of URLs (real commas in the URL should be encoded
145130
as ``%2C``).
146131

147132
Finally, you can also set a custom baseline directory globally when
148-
running tests by running ``py.test`` with:
149-
150-
::
133+
running tests by running ``pytest`` with::
151134

152-
py.test --mpl --mpl-baseline-path=baseline_images
135+
pytest --mpl --mpl-baseline-path=baseline_images
153136

154137
This directory will be interpreted as being relative to where the tests
155138
are run. In addition, if both this option and the ``baseline_dir``
@@ -190,9 +173,7 @@ Test failure example
190173

191174
If the images produced by the tests are correct, then the test will
192175
pass, but if they are not, the test will fail with a message similar to
193-
the following:
194-
195-
::
176+
the following::
196177

197178
E Exception: Error: Image files did not match.
198179
E RMS Value: 142.2287807767823
@@ -226,7 +207,7 @@ By default, the expected, actual and difference files are written to a
226207
temporary directory with a non-deterministic path. If you want to instead
227208
write them to a specific directory, you can use::
228209

229-
py.test --mpl --mpl-results-path=results
210+
pytest --mpl --mpl-results-path=results
230211

231212
The ``results`` directory will then contain one sub-directory per test, and each
232213
sub-directory will contain the three files mentioned above. If you are using a
@@ -242,12 +223,10 @@ Running the tests for pytest-mpl
242223
--------------------------------
243224

244225
If you are contributing some changes and want to run the tests, first
245-
install the latest version of the plugin then do:
246-
247-
::
226+
install the latest version of the plugin then do::
248227

249228
cd tests
250-
py.test --mpl
229+
pytest --mpl
251230

252231
The reason for having to install the plugin first is to ensure that the
253232
plugin is correctly loaded as part of the test suite.

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ pytest11 =
3434
test =
3535
pytest-cov
3636
matplotlib
37-
pillow

0 commit comments

Comments
 (0)