semvec/pypi-packages huggingface dataset:
auto-pytester 0.1.4
Auto generate pytest cases from docstring examples
License: MIT
Requires Python: >=3.8

# Auto-Pytester  
> *“先写函数签名 + 一行注释 → 自动生成完整单元测试”*

Auto-Pytester 帮你把 **TDD 的前置成本降到零**：  
只需在函数/方法里贴上带有示例的 docstring，即可一键生成 `pytest`/`unittest` 用例文件，保持代码与测试同步演进。

---

## ✨ 特性
- 🚀 **零配置** 复制粘贴即可用  
- 🧪 支持 **pytest** / **unittest** 双格式  
- 📦 支持 **YAML / JSON / TOML** 示例语法  
- 🐍 支持 **同步 & 异步** 函数  
- 🏗️ 支持 **嵌套类 / 继承 / 泛型**  
- 📁 支持 **monorepo** 多包扫描  

---

## 🚀 30 秒上手

### 1. 安装
```bash
pip install auto-pytester
```
🛠️ CLI 参考
```bash
tester@Paradox2024:~/app$ auto-pytest --help
usage: auto-pytest [-h] [-o OUTPUT_DIR] [-i INCLUDE] [-e EXCLUDE] [-I] [-v] project_dir

Auto generate pytest cases from docstring YAML examples

positional arguments:
  project_dir           Root of the Python project

options:
  -h, --help            show this help message and exit
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Output dir for tests (default: tests-auto)
  -i INCLUDE, --include INCLUDE
                        Glob to include (repeatable)
  -e EXCLUDE, --exclude EXCLUDE
                        Glob to exclude (repeatable)
  -I, --inplace         Generate test_xxx.py next to sources
  -v, --verbose         Show verbose output
```


### 2. 编写您的业务代码，当然只需要空壳子和示例数据即可
#### 业务代码示例
```python
# /bin/bash

class Calc:
    @classmethod
    def add(cls, a: int, b: int) -> int:
        """
        加法

        Examples:
            >>> yaml
            doc: "expect 2 + 3 == 5"
            input:
              a: 2
              b: 3
            output: 5
            <<<
        """
        return 0
```

### 3. 生成测试
```bash
tester@Paradox2024:~/app$ auto-pytest -o testcases -v .
[INFO] Scanning ~/app
[scan_project] elapsed: 0.001ms
[render_tests] elapsed: 0.622ms
[INFO] Generated 7 test cases in ~/app/testcases
```
#### 生成的测试文件如下
```python
"""
Tests for class `Calc`
Generated by auto-pytester — DO NOT EDIT MANUALLY.
"""
import pytest

from src.calc import Calc


@pytest.fixture
def calc():
    return Calc()

def test_Calc_div_0(calc):
    result = calc.div(**{'a': 6, 'b': 3})
    assert result == 2

def test_Calc_div_1(calc):
    with pytest.raises(ValueError):
        result = calc.div(**{'a': 1, 'b': 0})
```

### 4. 执行测试
```bash
tester@Paradox2024:~/app$ pytest testcases/ -q 
======================= test session starts =======================
platform linux -- Python 3.11.13, pytest-8.4.1, pluggy-1.6.0 -- ~/app/.venv/bin/python3
cachedir: .pytest_cache
rootdir: ~/app
configfile: pytest.ini
plugins: allure-pytest-2.13.5, assume-2.4.3
collected 6 items

tests-auto/test_Calc.py::test_Calc_add_0 PASSED
tests-auto/test_Calc.py::test_Calc_add_1 PASSED
tests-auto/test_Calc.py::test_Calc_div_2 PASSED
tests-auto/test_Calc.py::test_Calc_div_3 PASSED
tests-auto/test_cx.py::test_cx_0 PASSED
tests-auto/test_cx.py::test_cx_1 PASSED

======================= 6 passed in 0.02s =======================
``` 

---

### 📜 License

#### MIT © EveryOne

让测试成为副产品，专注业务。Happy TDD! 🎉
investec-python 1.1.0
A Python wrapper for the Investec Banking API
License: MIT
Requires Python: >=3.11

# investec-python
> A Python wrapper for the Investec Banking API
---
![PyPI - Version](https://img.shields.io/pypi/v/investec-python?style=for-the-badge)
![PyPI - Downloads](https://img.shields.io/pypi/dm/investec-python?style=for-the-badge)
![PyPI - License](https://img.shields.io/pypi/l/investec-python?style=for-the-badge&color=blue)
---
🛣️ [Project Roadmap](https://github.com/users/rameezk/projects/1/views/1?filterQuery=repo%3A%22rameezk%2Finvestec-python%22)

📘 [Documentation](./docs/index.md)

---

## 🚀 Quickstart

Install it:
```shell
pip install investec-python
```

Run it:
```python
from investec_python import Investec

investec = Investec(use_sandbox=True)
accounts = investec.accounts.list()

for account in accounts:
    account_balance = account.balance()
    account_transactions = account.transactions()
```

For interacting with real account data see [here](./docs/index.md#generating-the-client-credentials).

## Goals

- Interact with the Investec Banking API in the most Pythonic way possible
- 100% feature parity with the Investec Banking API
soc-executor 0.1.0
SOC工具执行器 - 执行本地Python文件并通过HTTP API提交
License: MIT
Requires Python: >=3.7
Keywords: soc, security, automation, http-client

# SOC Executor

SOC工具执行器 - 执行本地Python文件并通过HTTP API提交到SOC平台

## 功能特性

- 读取本地Python脚本文件
- 通过HTTP API提交代码到SOC平台执行
- 支持环境变量配置
- 命令行工具，使用简单
- 支持传递JSON格式参数

## 安装

```bash
pip install soc-executor
```

## 使用方法

### 基本用法

```bash
# 执行Python文件
soc-executor script.py

# 使用 --file 参数
soc-executor --file /path/to/script.py

# 传递参数
soc-executor script.py --params '{"key": "value"}'
```

### 环境变量配置

```bash
export HTTP_BASE_URL="http://your-soc-server:port"
export HTTP_TOKEN="your-api-token"
```

## 示例

创建一个测试脚本 `test_script.py`:

```python
def test_function():
    print("Hello from SOC executor!")
    return {"status": "success", "message": "Test completed"}

if __name__ == "__main__":
    result = test_function()
    print(result)
```

执行脚本:

```bash
soc-executor test_script.py
```

## 开发

使用 uv 进行开发环境管理:

```bash
# 安装开发依赖
uv sync --dev

# 运行测试
uv run pytest

# 构建包
uv run python -m build
```

## 许可证

MIT License