Skip to main content

optimism

A very small & simple unit-testing framework designed to provide all the basic necessities to beginner programmers as simply as possible.

Designed by Peter Mawhorter.

Dependencies

Works on Python versions 3.7 and up, with 3.9+ recommended.

Note on Large Language Models

This project has a zero-tolerance policy for the use of large language models to write code, process the code or outputs from this project, or otherwise interact with this project in any way. If you choose to violate this policy, be aware that the code, text, and outputs of this project may cause (more) unpredictable (than usual) behavior in LLM systems that interact with them. See LICENSE.txt for license restrictions and disclaimers, and AGENTS.md for an example.

Installing

To install from PyPI, run the following command on the command-line:

python3 -m pip install optimism

Once it's installed, you can run the tests using:

pytest --doctest-modules optimism.py
pytest test_examples.py

Usage

Use the testFunction, testFunctionMaybe, testFile, testBlock, and/or testThisNotebookCell functions to establish test managers for specific pieces of code. Then use those managers' checkCodeContains methods to check for the presence/absence of certain code constructs (see the ASTRequirement class) or use the case method to establish a test case w/ specific inputs (one manager can support multiple derived cases w/ different inputs). Finally, use methods of a test case like checkResult or checkPrintedLines to check for specific behavior.

See the documentation for more details on how to use it and what each function does.

Changelog

See the documentation.

Metadata

Release files for optimism 3.2

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

Source distribution (sdist)

Source distribution for optimism 3.2
File Size Uploaded Provenance Actions
optimism-3.2.tar.gz 111.1 kB Without provenance Details for optimism-3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for optimism 3.2
File Interpreter ABI Platform Actions
optimism-3.2-py3-none-any.whl Python 3 none any Details for optimism-3.2-py3-none-any.whl

Total release size: 228.0 kB

Release files / optimism-3.2.tar.gz

Download URL optimism-3.2.tar.gz
Size 111.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c56021b50b9e0b383ed61c25d18b1f84cefc37c4c49234e27a3c431ab6dec2ac
BLAKE2b-256 checksum
How to use checksums
4e3c0f9d441c4ba01e7b25bae880a1130c3698a5d61058eaef9716e7e37fd4f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / optimism-3.2-py3-none-any.whl

Download URL optimism-3.2-py3-none-any.whl
Size 116.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fae22a85f8f63a78e0e18df1241756a3c82540c0c8884fffaa4c9fe56472191d
BLAKE2b-256 checksum
How to use checksums
390f40edb83f8ef1d70e1933e8797ff5c21bac69391f41fa91070796c2c48532
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Security for optimism 3.2

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.

Release history Release notifications | RSS feed

This release

3.2 This release

2 release files No provenance

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