Capturemock

Latest version: v2.4.2

Safety actively analyzes 723158 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 2

1.0

Enhancements:

- Supports python callbacks in a limited fashion (i.e. intercepted code calling back into non-intercepted code)
Indented syntax for this. Makes it possible to e.g. intercept Tkinter and use CaptureMock for a limited kind of GUI
testing.
- Should work better in Python 3
- Naming of "variables" is more intelligent and descriptive, make use of strings provided when the objects first appear
- Mock files are more readable, we use pprint to ensure it doesn't get too wide
- Client-server support now handles XMLRPC servers

Bugfixes:
(Python)
- Don't overwrite sys.meta_path, should work better with py.test (Thanks Marc Abramowitz)
- Fixing custom metaclass issues in https://bugs.launchpad.net/capturemock/+bug/1256218 (Thanks Marc Abramowitz)
- Callstack checking, and hence not recording stuff used from the standard library, should work better in virtual
environments now
- Supports use of Abstract Base Classes, i.e. collections.MutableMapping etc
- Does not fail on classes named Instance
- Handle multiline strings starting with a '
- Handle exceptions raised by constructors properly
- Handle standard iterators produced by custom lists
- Fixed bug with attributes of list objects (Thanks Marc Abramowitz again)
- Special handling of __file__, it rarely makes sense to record this
- Making mixed mode more useful for Python attributes: use any replay info which matches at least function names
- Don't repeat base class descriptions unnecessarily
- Don't leak temporary files if exceptions are thrown
- Improve handling of very deep inheritance structures
- Handle subclasses of immutable types like int
- Handle multiline strings in lists
- Handle submodules imported via other packages
- Handle __nonzero__ methods properly (Thanks Lars Stavholm)
- Handle exceptions thrown by __dir__ methods
- Better handling of repeated references to the same attribute when replaying
- Trying to handle side-effect assignments properly, notice when their value changes
(Command line)
- If the same location is added several times to e.g. PATH, only mention it once in command line calls.
- Preventing server crashes if file edits are found more than once
- File edits now treat environment variables the same way as command line options, and hence find more files
- File edits are more threadsafe, simultaneous edits should not interfere
- Handle edits that turn a link into a directory
- Fixing diagnostic related problems if no logging.conf exists
(Client-Server)
- Client responses are returned in order, not using matching

0.3.1

Bugfixes:
- Make sure wrapped functions that return values preserve the return values (Thanks Carol Lin)

0.3

Enhancements:

- Now support 'inheriting across the interception boundary'
i.e. having your non-intercepted code inherit from classes you're intercepting
- Traffic alterations ("alterations" in the RC file) now also enabled on traffic from custom clients
- Can now enforce exact matching (i.e. disable the best-guess matching) when replaying.
New rc file entry "use_exact_matching". See website.

Bugfixes:

- Warn when provided RC file doesn't exist

0.2

Enhancements:

- Added possibility to write a custom client, reusing the CaptureMock server. See website.

Bugfixes:

- TCP backlog for server greatly increased to avoid trouble on overloaded networks
- Command line now recreates rather than appending to any existing mock files
- Now handle the situation where getattr creates new objects instead of just returning the same one
for example when using xmlrpc
- Don't cause __nonzero__ methods to be called unnecessarily on intercepted objects
- Fixed bug which caused import problems when recording in some obscure situations
- "check_repeated_calls" now also works with "partial interception", previously only worked when intercepting entire modules

0.1.1

- Fix to make it work with test discovery, e.g. nosetests (thanks Kumar McMillan)

0.1

- initial release, derived from "Traffic mechanism" in TextTest 3.20
- for changes compared to that version, see ChangeLog in TextTest 3.21 release

Page 2 of 2

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.