Skip to main content

Mock file tree

Globally replace a module with a configurable fake.

Status

Source Shields
Project release license lines languages
Health codacy readthedocs github_review codacy_coverage
Repository issues issues_closed pulls pulls_closed
Publishers pypi python_versions pypi_downloads
Activity contributors monthly_commits last_commit

Installing

pip install fake-module

Usage

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

Tests

To run unit tests and generate a coverage report:

grunt test

Documentation

This repository's documentation is hosted on readthedocs.

Tooling

To run linters:

grunt lint

To run formatters:

grunt format

Continuous integration

This repository uses github actions to lint and test each commit. Formatting tasks and writing/generating documentation must be done before committing new code.

Versioning

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

Changelog

Please read this repository's CHANGELOG for details on changes that have been made.

Contributing

Please read this repository's guidelines on CONTRIBUTING for details on our code of conduct and the process for submitting pull requests.

Contributors

Buy Me A Coffee

Remarks

Lots of love to the open source community!

Be kind

Metadata

Release files for fake-module 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fake-module 1.0.0
File Size Uploaded
fake_module-1.0.0.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fake-module 1.0.0
File Interpreter ABI Platform
fake_module-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.3 kB

Release files / fake_module-1.0.0.tar.gz

Download URL fake_module-1.0.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
680b64d1abb8197311b68aaa6c7d63e8be567ec01ff202d229f1a301a863a1a1
BLAKE2b-256 checksum
How to use checksums
75d0e337be780281d79d7726ac2a3ba6217601983d6242734876ae50c370452c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.0

Release files / fake_module-1.0.0-py3-none-any.whl

Download URL fake_module-1.0.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2cf7fb4b1c483afdd3f29a9229321e8f70ef7573d54c8495f0247fa6a3b66a57
BLAKE2b-256 checksum
How to use checksums
66bb9041ff8eb80a8f43fb6760f0ca725766b840bc812af83a3a4ecd709481ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.0

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page