Skip to main content

a simple module for testing out functions and catching its errors

Project description

This module allows you to easily test simple functions. All errors will be catched and showed to you gracefully.

Note that this module is incredibly basic and does not work with any kind of indented code, so e.g. for loops are not an option.

code examples:

>>> from easyerrors import test
>>> 
>>> @test
>>> def tryout(msg, num):
... 	print(msg, num)
...
>>> tryout('hey', 3)

Testing code inside function 'tryout':

-------- Test started! --------

>>> print(msg, num,)
hey 3


-------- Test ended! --------
>>> from easyerrors import test
>>> 
>>> @test
>>> def tryout(msg, num):
... 	print(msg, num)
... 	print(invalidargument)
...
>>> tryout('hey', 3)

Testing code inside function 'tryout':

-------- Test started! --------

>>> print(msg, num)
hey 3

>>> print(incorrectargument)
Error: name 'incorrectargument' is not defined


-------- Test ended! --------

 Errors found:
  - name 'incorrectargument' is not defined
  

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

easyerrors-1.0.0.tar.gz (2.9 kB view hashes)

Uploaded Source

Supported by

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