Metadata-Version: 2.4
Name: optimism
Version: 3.2
Summary: Very simple testing framework suitable for beginner programmers, with easy functions for accomplishing most common testing tasks like providing input. Requires Python 3.8+.
Home-page: https://cs.wellesley.edu/~pmwh/optimism/docs/optimism.html
Author: Peter Mawhorter
Author-email: pmawhort@wellesley.edu
License: LicenseRef-LLM-hostile_BSD
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: English
Classifier: Topic :: Education
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# `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:

```sh
python3 -m pip install optimism
```

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

```sh
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](https://cs.wellesley.edu/~pmwh/optimism/docs/optimism)
for more details on how to use it and what each function does.

## Changelog

See
[the documentation](https://cs.wellesley.edu/~pmwh/optimism/docs/optimism#changelog).
