StrongMock is a powerful mocking library for Python that leverages low-level ctypes functionality to provide extensive mocking capabilities. Some care may be needed while using this.
Project description
StrongMock
StrongMock is a powerful mocking library for Python that leverages low-level ctypes functionality to provide extensive mocking capabilities. Some care may be needed while using this.
Functionality
This applies when the target of a strongmock.strongpatch
is a function defined in python with a __code__
attribute. For other cases (methods in a class, classes, lbrary functions in c, etc.), the behaviour is the same as unittest.patch
.
This will patch the __code__
attribute of the function to call the mock, meaning that references will also have the functionality of mock.
This can be extremely convenient in some cases.
Usage
instead of unittest.mock.patch
use strongmock.strongpatch
Links
License
StrongMock is licensed under the Unlicense. See the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file strongmock-0.0.2.tar.gz
.
File metadata
- Download URL: strongmock-0.0.2.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1001cda1bcf07b23ac857465e08bafca972434f384d7b5f3a303f48168848387 |
|
MD5 | 1e8d3b0813e1b86458453c2ba16d579e |
|
BLAKE2b-256 | 21196c341e951761c789690fd8a214178ba22837756924cc73204bd91c80ab9f |
File details
Details for the file strongmock-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: strongmock-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3e8bf5b12c117f0cdde0b0918edf9595dfcecb1cd69bbb629bd0a2533112475 |
|
MD5 | 458c3fa7b604ac068461644ab5c19b29 |
|
BLAKE2b-256 | e18f225e7bca447f68ddacd6c0611aadb3bacbc5c4350e6c246258948a2188ba |