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.0.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.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crashbytes_testkit-1.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 6eb44c815c40a79af9a5306db2b037d6e2b900250358240b1b4b2a5b850c1cd6
MD5 e2bafc36775dff61c59fdf28723e44a9
BLAKE2b-256 5cfa406a69bfc3eaa0efb393639461b67bdf6fe041ff4d379f0a4249dba3b5e9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for crashbytes_testkit-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6275f58bb79e2db6136fa5d3f7440f26c09450f6b9353a77008f46ca659ad749
MD5 237f4f5bdac165683883f3422b468ba8
BLAKE2b-256 f5bf0fe363d6043b02e84268276cb81af824c0abb499a2eca54698a2dd6797f5

See more details on using hashes here.

Provenance

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