Skip to main content

Automate tests via docstrings and more

Project description

Fastest

Creates unit tests from examples in the docstring and more

Install

$ pip install fastest

Usage

$ python main.py --path=$(pwd) --source=<source>

where path is the the project root, and source is same as the value passed to the command coverage run -m unittest --source=$source test

Introduction

Things that happen when you run python main.py --path=$(pwd) --source=<source> in your python project:

  1. Checks for a test file at the project root, it creates if it doesn't find one.
  2. Watches .py files for changes.
  3. Creates unittests if a function has examples in its docstrings like so:
# .
# ├──module_a
# ├──module_b
#    └── utils.py
#
def add(x, y):
    """
    example: add(3, 4) -> 7 #
    """
    return x + y

This will create a unittest in the test directory, assertEqual(add(3, 4), 7) within Class test_<file>_<function>(self) (for the given directory, tree: Class test_utils_add(self))

  1. Runs all tests that are created.
  2. Creates a coverage report (in html format).
  3. Print the link to the coverage reports' index.html.

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

fastest-0.0.8.tar.gz (7.8 kB view hashes)

Uploaded Source

Built Distribution

fastest-0.0.8-py3-none-any.whl (23.0 kB view hashes)

Uploaded Python 3

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