Very simple testing framework suitable for beginner programmers, with easy functions for accomplishing most common testing tasks like providing input. Use with Python >=3.9 for best results, but it should be compatible with Python >=3.6.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file optimism-3.1.tar.gz
.
File metadata
- Download URL: optimism-3.1.tar.gz
- Upload date:
- Size: 91.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9528fa6150f10169d52ae8db8f10d28cd7731b93a70a5750d56193e71cfeb46 |
|
MD5 | 04121da0497479099d9a909aee8503bf |
|
BLAKE2b-256 | 57ff84e9cd22ecb93c9a1968896ae9aecdb472fab0345268379262f3caa29171 |
File details
Details for the file optimism-3.1-py3-none-any.whl
.
File metadata
- Download URL: optimism-3.1-py3-none-any.whl
- Upload date:
- Size: 91.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d46d06b314a492500da2e9362dc1cd0880ce1ae08fe78339ca540fac9d62d06a |
|
MD5 | d7695dcb4b3ead6dba3d8e49df0c4c9e |
|
BLAKE2b-256 | d85d87ff4f5e17935c54985bd97078b829606f995280acc2fac0dc71805b6c5f |