Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gsejas/ai-generate-unittest
https://github.com/gsejas/ai-generate-unittest
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gsejas/ai-generate-unittest
- Owner: GSejas
- Created: 2023-06-19T12:10:46.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-06-19T12:10:53.000Z (over 1 year ago)
- Last Synced: 2023-10-02T03:34:08.830Z (over 1 year ago)
- Language: Python
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ai-generate-unittest
# Pytest Unit Test GeneratorThis command-line tool generates Pytest unit tests for Python functions. It uses OpenAI's GPT-3 to generate high-quality test cases that verify the behavior of the function for a wide range of possible inputs and edge cases.
## Requirements
- Python 3.6 or higher
- Pytest
- OpenAI API credentials## Installation
1. Clone this repository: `git clone https://github.com/your-username/pytest-unit-test-generator.git`
2. Install the required packages: `pip install -r requirements.txt`
3. Set up your OpenAI API credentials by following the instructions [here](https://beta.openai.com/docs/authentication).
4. Configure the tool's settings by editing the `config.py` file.## Usage
python main.py function_name --pytest_path=path/to/pytest/files --auto_accept
- `function_name`: the name of the Python function to generate a unit test for.
- `--pytest_path`: the path to the Pytest files. Defaults to `tests/`.
-