Skip to main content

Test data builders for Python — auto-generate dataclass instances from type hints.

Project description

crashbytes-testkit

Test data builders for Python — auto-generate dataclass instances from type hints.

Install

pip install crashbytes-testkit

Usage

from dataclasses import dataclass
from crashbytes_testkit import Fixture, Builder

@dataclass
class User:
    name: str
    age: int
    email: str

# Auto-generate from type hints
user = Fixture.create(User)
users = Fixture.create_many(User, 5)

# Override specific fields
admin = Fixture.create(User, name="Admin", age=30)

# Fluent builder
user = (
    Builder(User)
    .with_field("name", "Alice")
    .with_field("age", 25)
    .build()
)

Supports: str, int, float, bool, bytes, datetime, date, UUID, list[T], dict[K,V], set[T], tuple, Optional[T], nested dataclasses.

License

MIT

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

crashbytes_testkit-1.1.3.tar.gz (40.9 kB view details)

Uploaded Source

Built Distribution

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

crashbytes_testkit-1.1.3-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file crashbytes_testkit-1.1.3.tar.gz.

File metadata

  • Download URL: crashbytes_testkit-1.1.3.tar.gz
  • Upload date:
  • Size: 40.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for crashbytes_testkit-1.1.3.tar.gz
Algorithm Hash digest
SHA256 205f78fa1dee7cb3daaf442158cd1b8f38671c4c389d9f40ccc39d0afeb3d073
MD5 a0dcc91f5cb42fa7c5d1fb496e44a616
BLAKE2b-256 6e3bb05d7015cd53da58999fec55b774f1d65adda3e25e96b6bbffc95159d2d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for crashbytes_testkit-1.1.3.tar.gz:

Publisher: publish.yml on CrashBytes/crashbytes-testkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file crashbytes_testkit-1.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for crashbytes_testkit-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e204a979f8098b378cfd68418eb96219a5d35c382a3699b88da6841e844e30e5
MD5 119ad3cd46a6f4620b812e1a50077357
BLAKE2b-256 73aca7f107a053ad7a3c800b2af5fc1b498be578e2f298422cb961ec9ba02d88

See more details on using hashes here.

Provenance

The following attestation bundles were made for crashbytes_testkit-1.1.3-py3-none-any.whl:

Publisher: publish.yml on CrashBytes/crashbytes-testkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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