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.
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.
Release files for optimism 3.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| optimism-3.1.4.tar.gz | 110.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| optimism-3.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 226.0 kB
Release files / optimism-3.1.4.tar.gz
| Download URL | optimism-3.1.4.tar.gz |
|---|---|
| Size | 110.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6787f18f412f7c92e0a3671dbe144e9af3666eb7acfca2a8bfd71105075c981
|
|
BLAKE2b-256 checksum How to use checksums |
e2f890450877915f50fbafbe0cb588b20cee21d0b3336b4e2265167e1fa45132
|
| 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.1.4-py3-none-any.whl
| Download URL | optimism-3.1.4-py3-none-any.whl |
|---|---|
| Size | 116.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe914a7ef256e7352e3ea07386bd551dac724fd83fe4ea18f435ba20973ab8dc
|
|
BLAKE2b-256 checksum How to use checksums |
3959ba3a586a875caa29da68c5a6439f9e063f726eea02715bc13ec08d2c85e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|