Skip to main content

generate unit tests for python code

Project description

WIP: unit test case generator for python in golang style

TODO:

  • support pytest
  • support methods
  • write more tests
  • far future: autoimport neccesary types for tests
  • write FAQ and create simple github page

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.2.tar.gz (2.9 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.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_unit_generator-0.0.2.tar.gz
  • Upload date:
  • Size: 2.9 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.2.tar.gz
Algorithm Hash digest
SHA256 2a0f8a4061168bae01242667df6c295c19cac7a079e1c23fd6f5a8bdd9bca5da
MD5 d7ab9816d660a752bdb9dca2dbcdb2ac
BLAKE2b-256 a821a3568387eb18358327046d3a1a0e130f6eaa15c86d1aa7b5085a1788721f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_unit_generator-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a47eae72b86936ece2673d72072e365edeef65b396cdd68f7cecd7978cb626f2
MD5 ea25db5cfdd8d6e3834f796cd5749f49
BLAKE2b-256 92c30a0ccac6683f7465fa166942084226abecb7ae77d87bfe67c40eb85d0f88

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