Skip to main content

Yet another mocking library

Reason this release was yanked:

This is completely unusable, nobody should ever install it

Project description

Mock The Python

What is it?

A library that makes mocking in Python better by building on type of Python's built in mock library.

How?

Currently, just by allowing members of modules which are being patched to be patched by using references to the actual members, instead of bare strings.

Here's an example:

from mock_the_python.mock_path import at
from unittest.mock import patch

import another_module.module_under_test
from another_module.module_under_test import bacon

patch(at(another_module.module_under_test).member(bacon), return_value="mmmm, bacon")

Now you can freely rename bacon to sausage without worrying about whether or not your refactoring tools will find string references, and your tests will still pass. Groovy.

More features will be added to this library

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

mock_the_python-0.1.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mock_the_python-0.1.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file mock_the_python-0.1.0.tar.gz.

File metadata

  • Download URL: mock_the_python-0.1.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.10.12 Linux/6.8.0-47-generic

File hashes

Hashes for mock_the_python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b8ec858a65ef62ce8ae205fb7a1e7ce46e0f19dafb20fe4f03c38fefa45fb39a
MD5 bd9445323ae9da86d97c308049bd214a
BLAKE2b-256 84f18d7c306f458cae6b665a01af207faf80ddea1d87b674b5b923ff105db17a

See more details on using hashes here.

File details

Details for the file mock_the_python-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mock_the_python-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.10.12 Linux/6.8.0-47-generic

File hashes

Hashes for mock_the_python-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 382f99846f3b03842e66f6a0609ac182b3c46e3a196fae28f93189923dbc35cb
MD5 8668c59cf611ba563cbbea83924be6df
BLAKE2b-256 2c6e349492a4d43c31d8c3544a7797421ad343d99aa05e70689236beecf42a02

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page