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

Uploaded Python 3

File details

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

File metadata

  • Download URL: crashbytes_testkit-1.1.1.tar.gz
  • Upload date:
  • Size: 5.5 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.1.tar.gz
Algorithm Hash digest
SHA256 c915f97154c8b61bae78cfd7ed2ca9096cbd29cc8ab40abfbd917d0c5448f880
MD5 0a1755c2296a5ad81bb47210a98fb464
BLAKE2b-256 557dc7260e660dbdd11313b4eb427899dca419e4d8fccfe6daec3f4b586b0653

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for crashbytes_testkit-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b7f7573ba8307c8c083880d73535f17c91d82a210d363428f72aaa2d99bd0e77
MD5 d50ceb980c24176565c480d15cd72e6e
BLAKE2b-256 110ffb6350130915c6b295e489a2ca66aec0985f14328aa22029872481edfbf2

See more details on using hashes here.

Provenance

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