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.4.tar.gz (41.0 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.4-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crashbytes_testkit-1.1.4.tar.gz
  • Upload date:
  • Size: 41.0 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.4.tar.gz
Algorithm Hash digest
SHA256 8951d9099ea1309ecc567aaed7593a282db922510a6d534fea31830f92fb5517
MD5 7fbecd0e35521898043048fb0e97b1f8
BLAKE2b-256 ad0d4857d04a28db600ddd6ef950d1c66f9404095923d097217b4f83a97e6c15

See more details on using hashes here.

Provenance

The following attestation bundles were made for crashbytes_testkit-1.1.4.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.4-py3-none-any.whl.

File metadata

File hashes

Hashes for crashbytes_testkit-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0d7b712fd42223eb5358ea553099b38a4a05032ae90aaff3d9f64ab8e0e7eba2
MD5 4047f21342257f433fd26d5a2976f7cc
BLAKE2b-256 6eae3d14bb867a1aede0e57a213433005775bbfc5cbaf613a1615f2551265bb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for crashbytes_testkit-1.1.4-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