Skip to content

Commit

Permalink
Reword readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
tybug committed Feb 26, 2025
1 parent 3453f36 commit 4b2a13f
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 110 deletions.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<div align="center">
<img src="./brand/dragonfly-rainbow.svg" width="300">
</div>

# Hypothesis

* [Website](https://hypothesis.works/)
* [Documentation](https://hypothesis.readthedocs.io/en/latest/)
* [Source code](https://github.com/hypothesisWorks/hypothesis/)
* [Contributing](https://github.com/HypothesisWorks/hypothesis/blob/master/CONTRIBUTING.rst)
* [Community](https://hypothesis.readthedocs.io/en/latest/community.html)

Hypothesis is the property-based testing library for Python. A property-based test asserts something for *all* inputs, and lets Hypothesis generate them — including inputs you may not have thought of.

```python
from hypothesis import given, strategies as st


@given(st.lists(st.integers() | st.floats()))
def test_matches_builtin(ls):
assert sorted(ls) == my_sort(ls)
```

Additionally, when a property fails, Hypothesis doesn't just report any failing example — it reports the simplest possible one. This makes property-based tests a powerful tool for debugging, as well as testing.

For instance,

```python
def my_sort(ls):
return list(reversed(sorted(ls, reverse=True)))
```

fails with:

```
Falsifying example: test_matches_builtin(ls=[0, math.nan])
```

### Installation

To install Hypothesis:

```
pip install hypothesis
```

There are also [optional extras available](https://hypothesis.readthedocs.io/en/latest/packaging.html#other-python-libraries).
48 changes: 0 additions & 48 deletions README.rst

This file was deleted.

1 change: 1 addition & 0 deletions hypothesis-python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The Hypothesis python readme has moved to [the main readme](../README.md)!
59 changes: 0 additions & 59 deletions hypothesis-python/README.rst

This file was deleted.

4 changes: 2 additions & 2 deletions hypothesis-python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def local_file(name):
"pytest11": ["hypothesispytest = _hypothesis_pytestplugin"],
"console_scripts": ["hypothesis = hypothesis.extra.cli:main"],
},
long_description=local_file("README.rst").read_text(encoding="utf-8"),
long_description_content_type="text/x-rst",
long_description=local_file("README.md").read_text(encoding="utf-8"),
long_description_content_type="text/markdown",
keywords="python testing fuzzing property-based-testing",
)
2 changes: 1 addition & 1 deletion tooling/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def local_file(name):


SOURCE = local_file("src")
README = local_file("README.rst")
README = local_file("README.md")

setuptools.setup(
name="hypothesis-tooling",
Expand Down

0 comments on commit 4b2a13f

Please sign in to comment.