This release is a pre-release and may not be stable for production use.
manuelpi.fakemodule
A plugin to enable the definition and usage of whole Python modules from within doctests.
Intro and Motivation
manuelpi.fakemodule is a plugin for Manuel that supports syntax for creating modules within a doctest. The module, once defined, is then usable by subsequent doctest statements.
This functionality is useful for packages that you might describe as being ‘meta’; they operate on modules. Thus, being able to define and then process modules within the same doctest using a clean and uncluttered syntax is extremely beneficial.
One such package to benefit from this sort of facility is Martian, which scans modules for configuration directives, registering them as it goes.
Usage
The special REStructure Text directive:
'.. module-block:: <MODULE_NAME>'
is used to denote the start of a module and its alias <MODULE_NAME> for the rest of the doctest. We then define the module’s body at a single indentation level after this directive. What follows is an example of a full doctest:
We create a new module with a main function to perform this task::
.. module-block:: test_module
import sys
class A:
def do_something(self):
return "Hello World"
def main():
print A().do_something()
Now let's execute the main function
>>> test_module.main() Hello World
The above doctest creates a new module test_module and then exercises the objects within it. Notice how the module becomes immediately available to the doctet after its definition.
To use manualpi.fakemodule in your application, set up your tests as described in the Manuel documentation and import the Manuel class from manuelpi.fakemodule:
... import manuelpi.fakemodule ... m += manuelpi.fakemodule.Manuel()
CHANGES
0.1b1 (2009-12-16)
Initial Public Release
Metadata
Release files for manuelpi.fakemodule 0.1b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| manuelpi.fakemodule-0.1b1.tar.gz | 7.2 kB | Without provenance | Details for manuelpi.fakemodule-0.1b1.tar.gz |
Release files / manuelpi.fakemodule-0.1b1.tar.gz
| Download URL | manuelpi.fakemodule-0.1b1.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3772f6b2102501a78580f7575bc736eb76cb50d0c264ef4f9e751f05fd26d7e4
|
|
BLAKE2b-256 checksum How to use checksums |
830a24e0b5edb8b9491d4391a8890234647feb2c7d0fbfb7ebbbe37cd4bb9b5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for manuelpi.fakemodule 0.1b1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.