Globally replace a module with a configurable fake.
MIT License
Globally replace a module with a configurable fake.
pip install fake-module
Documentation and more detailed examples are hosted on Github Pages.
You can purge all of a module's members inside a context manager:
from fake_module import FakeModule
with FakeModule("colorsys"):
colorsys.rgb_to_hls()
... AttributeError
Or create a fake globally:
import colorsys
from fake_module import FakeModule
fake = FakeModule("colorsys")
fake.purge()
setattr(fake, "rgb_to_hls", 1)
colorsys.rgb_to_hls
1
To install dependencies:
yarn install
pip install .[all]
To run tests:
thx test
To generate the documentation locally:
thx docs
To run linters:
thx lint
To run formatters:
thx format
Please read this repository's Code of Conduct which outlines our collaboration standards and the Changelog for details on breaking changes that have been made.
This repository adheres to semantic versioning standards. For more information on semantic versioning visit SemVer.
Bump2version is used to version and tag changes. For example:
bump2version patch
Lots of love to the open source community!