Hypothesis strategies for generating Python programs, something like CSmith
Project description
hypothesmith
Hypothesis strategies for generating Python programs, something like CSmith.
This is definitely pre-alpha, but if you want to play with it feel free! You can even keep the shiny pieces when - not if - it breaks.
Get it today with pip install hypothesmith,
or by cloning the GitHub repo.
You can run the tests, such as they are, with tox on Python 3.6 or later.
Use tox -va to see what environments are available.
Changelog
0.0.7 - 2020-04-19
- The
from_grammar()strategy now takes anauto_target=Trueargument, to drive generated examples towards (relatively) larger and more complex programs.
0.0.6 - 2020-04-08
- support for non-ASCII identifiers
0.0.5 - 2019-11-27
- Updated project metadata and started testing on Python 3.8
0.0.4 - 2019-09-10
- Depends on more recent Hypothesis version, with upstreamed grammar generation.
- Improved filtering rejects fewer valid examples, finding another bug in Black.
0.0.3 - 2019-08-08
Checks validity at statement level, which makes filtering much more efficient. Improved testing, input validation, and code comments.
0.0.2 - 2019-08-07
Improved filtering and fixing of source code generated from the grammar.
This version found a novel bug: "pass #\\r#\\n" is accepted by the
built-in compile() and exec() functions, but not by black or lib2to3.
0.0.1 - 2019-08-06
Initial release. This is a minimal proof of concept, generating from the
grammar and rejecting it if we get errors from black or tokenize.
Cool, but while promising not very useful at this stage.
Project details
Release history Release notifications | RSS feed
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 hypothesmith-0.0.7.tar.gz.
File metadata
- Download URL: hypothesmith-0.0.7.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5aefbcf966c2c39eddf87a6eb8917999cc455783e15311bfe3692e696aa0f8fc
|
|
| MD5 |
aa82800dcfd5f2a6b622678dd74cec63
|
|
| BLAKE2b-256 |
da8e65b5f75daae205c187cdd703b2d643b1102702a24eda57d4a42406ba4864
|
File details
Details for the file hypothesmith-0.0.7-py3-none-any.whl.
File metadata
- Download URL: hypothesmith-0.0.7-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de5ed74c17bc1110b0badfd27bdd671b9b44b20bedb1051a6572e9391b920e09
|
|
| MD5 |
1afb58f750f99528eb12e9629d62ae19
|
|
| BLAKE2b-256 |
fddea042aac1302bbb1b3378813124789674d3a09153c8983179a546a5e2ad7c
|