Skip to content
Snippets Groups Projects
Commit 9463268a authored by fuzzyman's avatar fuzzyman
Browse files

No commit message

No commit message
parent b94d2a95
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ DEFAULT = object()
class Mock(object):
def __init__(self, methods=None, spec=None, side_effect=None,
name=None, parent=None):
return_value=DEFAULT, name=None, parent=None):
self._parent = parent
self._name = name
if spec is not None and methods is None:
......
......@@ -727,6 +727,26 @@ There are various disadvantages and things that Mock doesn't (yet) do.
CHANGELOG
=========
2008/10/XX Version 0.4.0
------------------------
* Default return value is now a new mock rather than None
* return_value added as a keyword argument to the constructor
* New method 'assert_called_with'
* Added 'side_effect' attribute / keyword argument called when mock is called
* patch decorator split into two decorators:
- ``patch_object`` which takes an object and an attribute name to patch
(plus optionally a value to patch with which defaults to a mock object)
- ``patch`` which takes a string specifying a target to patch; in the form
'package.module.Class.attribute'. (plus optionally a value to
patch with which defaults to a mock object)
* Change to patch for nose compatibility with error reporting in wrapped functions
* Reset no longer clears children / return value etc - it just resets
call count and call args. It also calls reset on all children (and
the return value if it is a mock).
2007/12/03 Version 0.3.1
-------------------------
......@@ -746,7 +766,6 @@ Removed ``patch_module``. ``patch`` can now take a string as the first argument
The third argument to ``patch`` is optional - a mock will be created by default if it is not passed in.
2007/11/21 Version 0.2.1
-------------------------
......@@ -756,7 +775,6 @@ Bug fix, allows reuse of functions decorated with ``patch`` and ``patch_module``
2007/11/20 Version 0.2.0
-------------------------
Added ``spec`` keyword argument for creating ``Mock`` objects from a specification object.
Added ``patch`` and ``patch_module`` monkey patching decorators.
......
setup.py 0 → 100755
#! /usr/bin/python
from setuptools import setup, find_packages
from mock import __version__
setup(
name = "mock",
version = __version__,
packages = [],
py_modules = ['mock'],
include_package_data = False,
zip_safe = True,
# metadata for upload to PyPI
author = "Michael Foord",
author_email = "fuzzyman@voidspace.org.uk",
description = "This is an Example Package",
license = "BSD",
keywords = "testing test mock mocking unittest patching stubs",
url = "http://www.voidspace.org.uk/python/mock.html",
# could also include long_description, download_url, classifiers, etc.
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment