Skip to main content

Simest - Simple and small code testing library for Python 3.8+

Project description

Simest - Simple and small code testing library for Python 3.8+

Simest is a simple and small code testing library for Python 3.8+

Installation

To install the Simest library, confirm you have Python 3.8 or higher and a usable installation of pip

$ pip install simest
OR
$ py -m pip install simest

Example

from simest import Tester

def foo(x: int) -> int:
    return x * 4

def runTests() -> None:
    tester = Tester()

    tester.equalCheck(32, foo, x = 8) # This will pass
    tester.equalCheck(16, foo, x = 16) # This will fail

if __name__ == "__main__":
    runTests()

Functions and types

Value

Class

Value.__init__(self, value: typing.Any, passed: bool, expected: typing.Any, func: typing.Any, **kwargs: typing.Any)

Tester

Class

Tester.__init__(self, title: typing.Optional[str] = "Test")
Tester.__outputCheck__(self, val: Value) # Private/Internal
Tester.__outputCheckTime__(self, val: Value) # Private/Internal

Tester.equalCheck(self, expect: typing.Any, func: typing.Any, **kwargs: typing.Any)
Tester.ruleCheck(self, rule: str, expect: typing.Any, func: typing.Any, **kwargs: typing.Any)
"""
**Unsafe with user-provided string due to usage of `eval`**
## Syntax:

 - `&r` - return value
 - `&e` - expected value
"""

Tester.timeCheck(self, func: typing.Any, max: typing.Union[int, float], min: t.Optional[typing.Union[int, float]] = 0, **kwargs)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Simest-1.1.tar.gz (2.3 kB view details)

Uploaded Source

File details

Details for the file Simest-1.1.tar.gz.

File metadata

  • Download URL: Simest-1.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.2

File hashes

Hashes for Simest-1.1.tar.gz
Algorithm Hash digest
SHA256 371d4a102ebe59b1eab264f118c083942699258e1e03b8c16f22976a4e767675
MD5 1fb7f226ebaa452d44f906b429c3924d
BLAKE2b-256 bab4173f3973d724bb97cff2bda5b33d9027c7403e2e825f765a415700fda699

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page