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 details)

Uploaded Source

File details

Details for the file easyerrors-1.0.0.tar.gz.

File metadata

  • Download URL: easyerrors-1.0.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.7.3

File hashes

Hashes for easyerrors-1.0.0.tar.gz
Algorithm Hash digest
SHA256 44da44e754ddd10b06c2837c5c1d0809d43efb5a46635741bd898622d4863c75
MD5 137ed6f0c4863fdd536f296c34274129
BLAKE2b-256 612528ea6efcbc0fe0b11fbf26ee779c1b42b62147bb73674cc06de411cf024b

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