Skip to main content

generate unit tests for python code

Project description

WIP: unit test case generator for python in golang style

now it geneates for python function:

def kek(arg1: int, arg2: str) -> str:
    return str(arg1) + arg2

source code like this:

    def test_kek():
        @dataclass
        class Args:
            arg1: int
            arg2: str


        @dataclass
        class Test:
            name: str
            args: Args
            want: str

        cases: tuple[Test] = (
            # TODO: add cases here
        )
        for case in cases:
            if (v := func(*case.args)) != case.want:
                print(f"{func.__name__()} got {v} wanted {case.want}")

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

python_unit_generator-0.0.1.tar.gz (1.5 kB view details)

Uploaded Source

Built Distribution

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

python_unit_generator-0.0.1-py3-none-any.whl (1.6 kB view details)

Uploaded Python 3

File details

Details for the file python_unit_generator-0.0.1.tar.gz.

File metadata

  • Download URL: python_unit_generator-0.0.1.tar.gz
  • Upload date:
  • Size: 1.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for python_unit_generator-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4c21b104380210ac0989828eab19c772f6bd785ca161369c9d921ffec025b35a
MD5 e2b00c6025a051a9e4ba397a11eed1d3
BLAKE2b-256 664d834af0debb2818fb7efc4c11cbf643e758d69c516b764b8ae5eae9de0b8b

See more details on using hashes here.

File details

Details for the file python_unit_generator-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_unit_generator-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f408b02c41b6169a450e363fddec05a90b7c4e921eb3de6d4a60d7a2de288d4
MD5 9174c244af4ba134ef6dd39197a89611
BLAKE2b-256 4c103ef7c5e0d8427cf281cf94c9a13ac09e7ec599bd3bf3bcc6531cfadf142d

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