Skip to main content

A CLI tool to generate pyton tests using AI.

Project description

TestForge

TestForge A CLI tool to generate pytest test cases using AI.

Features

  • Generate Tests: Automatically generates pytest test cases for a specified file or function.
  • Output Directory: Specify a custom output directory for the generated test files (default is the same as the file you're making tests for).
  • Configurable Endpoint: Set an environment variable TESTFORGE_INVITE for the endpoint URL.

Installation

Install TestForge via pip:

pip install testforge

Usage

Setting Up the Invite Code

TestForge requires an environment variable TESTFORGE_INVITE to get access to the beta. To set it up, use the following command:

export TESTFORGE_INVITE="YOURCODE"

Replace YOURCODE with the actual code you've received. This variable needs to be set in every session where you use TestForge or added to your shell configuration file (e.g., .bashrc or .zshrc) for persistence.

Command Options

TestForge provides several options that can be used in the command line:

  • Show Version: Check the version of TestForge.

    testforge -v
    
  • Generate Tests: Generate pytest cases for a specified file.

    testforge -f path/to/your/file.py
    
  • Generate Tests for a function only: Generate pytest cases for the specified function.

    testforge -f path/to/your/file.py -t function_name
    
  • Specify Output Directory: Define a custom directory for the generated test files.

    testforge -f path/to/your/file.py -o path/to/your/custom_output_directory
    

Example

export TESTFORGE_INVITE="INVITECODE"
testforge -f src/main.py -o tests

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

testforge-1.0.5.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

testforge-1.0.5-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file testforge-1.0.5.tar.gz.

File metadata

  • Download URL: testforge-1.0.5.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for testforge-1.0.5.tar.gz
Algorithm Hash digest
SHA256 7b8b9b63f19ea1069246bb16c7036974095a00fca9898ebce0c8ab95d5d00f15
MD5 254ee6ff3495ded63cba9f75e33e35b9
BLAKE2b-256 17200dffbabc30a669f6a47939a8299868e20def518008914a74ce974f217ef2

See more details on using hashes here.

File details

Details for the file testforge-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: testforge-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for testforge-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 24063c100cd464bbdfdb7eea495eaef1c2a6944324488bdc7001c631e240abf1
MD5 a3f66dba0314d4603977c52c7194469c
BLAKE2b-256 fbbbfd5f5c6a86da0549da0898b0391def6a8533b2fea391588403c0e7013bfe

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