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 Endpoint URL

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.4.tar.gz (7.7 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.4-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: testforge-1.0.4.tar.gz
  • Upload date:
  • Size: 7.7 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.4.tar.gz
Algorithm Hash digest
SHA256 2eab48c8a03697309b70bda9e7d4fcd6c03688b9ad4d2e35fb70f30f3bb5dca0
MD5 e0f15bdb64368b0fad297488a5ea0b33
BLAKE2b-256 3ce816508df7e2d95edb0353176a9d41d740dd40cf5c79d831d48a4bc570bf4d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: testforge-1.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b281d286834149b77a68765465014d48141ba95bfcdd9d9ca46837a1156ac93d
MD5 3f37dbec98830ba314ae411b7f5b04c3
BLAKE2b-256 d01c0ce100158b141b44f99fd43b318802634379a6d012018008dba98b0147d1

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