Skip to content

Commit 22d194d

Browse files
committed
Adjustments for PyPI release
1 parent 2a1be6c commit 22d194d

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

README.rst

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
===========
12
pytest-mock
23
===========
34

4-
This plugin installs a fixture ``mock`` which is a thin-wrapper around the patching API
5+
This plugin installs a ``mock`` fixture which is a thin-wrapper around the patching API
56
provided by the excellent `mock <http://pypi.python.org/pypi/mock>`_ package,
67
but with the benefit of not having to worry about undoing patches at the end
78
of a test:
@@ -16,28 +17,29 @@ of a test:
1617
1718
1819
Usage
19-
-----
20+
=====
2021

2122
The ``mock`` fixture has the same API as
2223
`mock.patch <http://www.voidspace.org.uk/python/mock/patch.html#patch-decorators>`_,
2324
supporting the same arguments:
2425

2526
.. code-block:: python
2627
27-
# all valid calls
28-
mock.patch('os.remove')
29-
mock.patch.object(os, 'listdir', autospec=True)
30-
mocked = mock.patch('os.remove')
28+
def test_foo(mock):
29+
# all valid calls
30+
mock.patch('os.remove')
31+
mock.patch.object(os, 'listdir', autospec=True)
32+
mocked = mock.patch('os.path.isfile')
3133
3234
The supported methods are:
3335

3436
* ``mock.patch``: see http://www.voidspace.org.uk/python/mock/patch.html#patch.
35-
* ``mock.patch.object``: see `http://www.voidspace.org.uk/python/mock/patch.html#patch-object.
36-
* ``mock.patch.multiple``: see `http://www.voidspace.org.uk/python/mock/patch.html#patch-multiple.
37+
* ``mock.patch.object``: see http://www.voidspace.org.uk/python/mock/patch.html#patch-object.
38+
* ``mock.patch.multiple``: see http://www.voidspace.org.uk/python/mock/patch.html#patch-multiple.
3739
* ``mock.stopall()``: stops all active patches at this point.
3840

3941
Why bother with a plugin?
40-
-------------------------
42+
=========================
4143

4244
There are a number of different ``patch`` usages in the standard ``mock`` API,
4345
but IMHO they don't scale very well when you have a more than one or two

setup.cfg

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[bdist_wheel]
2+
universal = 1
3+

setup.py

+4
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,18 @@
2121
author='Bruno Oliveira',
2222
author_email='[email protected]',
2323
description='Thin-wrapper around the mock package for easier use with py.test',
24+
long_description=open('README.rst').read(),
2425
keywords="pytest mock",
2526
classifiers=[
2627
'Development Status :: 3 - Alpha',
2728
'Intended Audience :: Developers',
2829
'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
2930
'Operating System :: OS Independent',
31+
'Programming Language :: Python :: 2.6',
3032
'Programming Language :: Python :: 2.7',
3133
'Programming Language :: Python :: 3',
34+
'Programming Language :: Python :: 3.2',
35+
'Programming Language :: Python :: 3.3',
3236
'Programming Language :: Python :: 3.4',
3337
'Topic :: Software Development :: Testing',
3438
]

0 commit comments

Comments
 (0)