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

Uploaded Python 3

File details

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

File metadata

  • Download URL: crashbytes_testkit-1.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 49f1189a6ba855304955ffbfa667bf0ee3ff7b25560242864a893a1e748e29cf
MD5 dc10334205943d14e8a61f442bfcba54
BLAKE2b-256 393fecefc3f0e4adf0f4d3d76a494d3fbad43c1e692b0a8ad5f743b9109866b2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for crashbytes_testkit-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 37ed34b69cdd056a49ca94793da7dbdbccbef1c5f8f5f53000b34fef0a6690bb
MD5 f26ca39b12c7a0d0a3c3395e80413fde
BLAKE2b-256 b85cb32690d45ba8a86b867b9d8f4fe073b2c4613390b7db876ab45c42c6ea07

See more details on using hashes here.

Provenance

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