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.6.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.6-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for testforge-1.0.6.tar.gz
Algorithm Hash digest
SHA256 c1b158dbdfd583e9b68ffcc18c76e53d553285a99fcbb57361c338bc604144c9
MD5 4509b76b897750c9aede4fd3578a990e
BLAKE2b-256 69ec295884ecf5a19fb25547efb51ebd97f868dc9696c06ec964659f833f94f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: testforge-1.0.6-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.20

File hashes

Hashes for testforge-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e196be0753f003c4c133b2044853d866b316808ff3c0b976241c85c45000c6b3
MD5 6803bb4f2ec487f76eb3647adf7ad110
BLAKE2b-256 0d90d584b188a527153684fcd25b242ef1902d07ba039fbb782e53d35aeba465

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