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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba9439ef88f1cbbcc1152b5587817cf5f4fadae9fe837926787356129c8ffe1e
|
|
| MD5 |
51f03077b64ac1a08f5522deb4d757c0
|
|
| BLAKE2b-256 |
80a7272026a0e175a84c557f861480c2d20cd643f5031fdbe635c016d5d1d551
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
207d1cbcebbd38d2a7e44ddffacf023d5d8a4bb7ba54231b8d50cb43eb67b346
|
|
| MD5 |
b3ee52421af8ba3e1a36d4ac61b86826
|
|
| BLAKE2b-256 |
904704c5efc9f772365e9ebf12efde416d7e55ab21af6fce25208c7bce836bae
|