Skip to main content

A LIB-rary of useful Python code

Project description

Alib provides simple testing without boilerplate. For example, if contains the line:

7 * 8 == 54  # I'm not sure about this!

then running:

$ python -m alib.test

will, because the test fails, report the test line and the nature of the failure:

line 3:  7 * 8 == 54  # I'm not sure about this!
(['Eq'], [ReturnValue(56), ReturnValue(54)])

Exceptions are caught. The input line:

(1 + '2') == 3  # Can we add a string to a number?


line 4:  (1 + '2') == 3  # Can we add a string to a number?
(['Eq'], [ExceptionInstance(TypeError), ReturnValue(3)]

This test line succeeds (because the left hand side raises the right hand side).:

(1 + '2') ** TypeError  # We can't add a string to a number.

To test all Python files in the folder path/to/mydir run the command:

$ python -m alib.test path/to/mydir

Project details

Download files

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

Files for alib, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size alib-0.0.1.tar.gz (6.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page