Skip to main content

tested

General python testing utils

To install: pip install tested

A little tour...

validate_codec

Let's start with validate_codec, a function to test encoder/decoder pairs.

>>> from tested import validate_codec

pickle.dumps/pickle.loads is the default encoder/decoder pair. You can pickle lists, and datetime objects

>>> validate_codec([1, 2, 3])
True
>>> from datetime import datetime
>>> validate_codec(datetime.now())
True

But you can't pickle a lambda function

>>> validate_codec(lambda x: x)
False
>>> from functools import partial
>>> import json
>>> validate_jsonability = partial(validate_codec, coder=json.dumps, decoder=json.loads)

You can jsonize lists and dicts

>>> assert validate_jsonability([1, 2, 3])
>>> assert validate_jsonability({'a': 1, 'b': {'c': [1, 2, 3]}})

You can't jsonize datetime objects

>>> from datetime import datetime
>>> validate_jsonability(datetime.now())
False

See validate_codec docs for more examples.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tested-0.1.25.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

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

tested-0.1.25-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file tested-0.1.25.tar.gz.

File metadata

  • Download URL: tested-0.1.25.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tested-0.1.25.tar.gz
Algorithm Hash digest
SHA256 ba9439ef88f1cbbcc1152b5587817cf5f4fadae9fe837926787356129c8ffe1e
MD5 51f03077b64ac1a08f5522deb4d757c0
BLAKE2b-256 80a7272026a0e175a84c557f861480c2d20cd643f5031fdbe635c016d5d1d551

See more details on using hashes here.

File details

Details for the file tested-0.1.25-py3-none-any.whl.

File metadata

  • Download URL: tested-0.1.25-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tested-0.1.25-py3-none-any.whl
Algorithm Hash digest
SHA256 207d1cbcebbd38d2a7e44ddffacf023d5d8a4bb7ba54231b8d50cb43eb67b346
MD5 b3ee52421af8ba3e1a36d4ac61b86826
BLAKE2b-256 904704c5efc9f772365e9ebf12efde416d7e55ab21af6fce25208c7bce836bae

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.25 This release

2 files

0.1.24

1 file

0.1.23

1 file

0.1.22

1 file

0.1.21

1 file

0.1.20

1 file

0.1.19

1 file

0.1.18

1 file

0.1.17

1 file

0.1.16

1 file

0.1.15

1 file

0.1.14

1 file

0.1.13

1 file

0.1.12

1 file

0.1.11

1 file

0.1.10

1 file

0.1.9

1 file

0.1.8

1 file

0.1.7

1 file

0.1.6

1 file

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

0.0.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page