Skip to main content

Test function call instances using a simple decorator.

Project description

What is Fancytest?

Fancytest provides a decorator to test function call instances in your program. It will output the status of both failed and successful instances.

How to use Fancytest?

pip install fancytest
from fancytest import ftest # <-- IMPORT THE PACKAGE

@ftest # <-- ADD THE DECORATOR TO THE FUNCTION YOU WANT TO TEST (@ftest)
def add(a, b):
    return a + b

@ftest # <-- ADD THE DECORATOR TO THE FUNCTION YOU WANT TO TEST (@ftest)
def squared(a):
    return a * a

# FAIL
f = add(2, "b")
squared(f)

# SUCCESS
s = add(1,2)
squared(s)

Fancytest will output all instances with their parameters and status.

INSTANCE: add(2, 'b') : FAILED
ERROR: unsupported operand type(s) for +: 'int' and 'str'

INSTANCE: squared(None) : FAILED
ERROR: unsupported operand type(s) for *: 'NoneType' and 'NoneType'

INSTANCE: add(1, 2) : SUCCESS
TIME: 0.000ms

INSTANCE: squared(3) : SUCCESS
TIME: 0.000ms

Project details


Release history Release notifications | RSS feed

This version

1.1

Download files

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

Source Distribution

fancytest-1.1.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fancytest-1.1-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fancytest-1.1.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.9

File hashes

Hashes for fancytest-1.1.tar.gz
Algorithm Hash digest
SHA256 ec4b2cfd8e2d312b88fa082142d1836933de2d79ddfe288e36452974ca9d9469
MD5 77e95402da0f0595e23c905da42feda3
BLAKE2b-256 b87989c6e8e61a7c844969e470eea2c15c20907ac0c84ebdf8abe77629fdf92c

See more details on using hashes here.

File details

Details for the file fancytest-1.1-py3-none-any.whl.

File metadata

  • Download URL: fancytest-1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.9

File hashes

Hashes for fancytest-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 62a92021a15fe3ffa79b204b1e56a5c45e09c1589a5e3b2ef79423b80525eeaf
MD5 75520331de5c970461409a09bb5a55e2
BLAKE2b-256 2e255ed80be74ceea3d664b90f6fa8cdc481acc97048ccad9c7f1faf69e76382

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