File: index.html

package info (click to toggle)
python-hypothesis 6.150.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,760 kB
  • sloc: python: 64,665; ruby: 1,107; sh: 270; makefile: 43; javascript: 6
file content (59 lines) | stat: -rw-r--r-- 2,704 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{% extends "base.html" %}

{% block content %}

<div class="home-page">

  <div class="article-content">
    <div class="main-page__header">
      <div class="main-page__header-text">
        Hypothesis
      </div>
    </div>

      <p>Hypothesis is the property-based testing library for Python. With Hypothesis, you write tests which should pass for all inputs in whatever range you describe, and let Hypothesis randomly choose which of those inputs to check - including edge cases you might not have thought about. For example:</p>

    <div class="article__code">
      <pre><code class="language-python">from hypothesis import given, strategies as st

@given(st.lists(st.integers()))
def test_matches_builtin(ls):
  assert sorted(ls) == my_sort(ls)</code></pre>
    </div>

      <p>This randomized testing can catch bugs and edge cases that you didn't think of and wouldn't have found. In addition, when Hypothesis does find a bug, it 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.</p>

      <h2>Recent Articles</h2>
      <div class="articles-grid">
        {% for article in articles[:3] %}
        {% include "article-card.html" %}
        {% endfor %}
      </div>
      <p style="margin: 3rem 0;">
        <a href="/articles/">More articles from the Hypothesis blog →</a>
      </p>

      <div class="separator" style="margin-top: 3rem; margin-bottom: 3rem;"></div>

      <div class="newsletter-box">
        <h2 style="margin-top: 0rem;">Hypothesis Quarterly</h2>
        <p>Every three months, we send out a roundup newsletter of what's new in Hypothesis and the Hypothesis ecosystem!</p>

        <form action="https://works.us16.list-manage.com/subscribe/post?u=96a2ac0812802282504dd335f&id=76e6edcda3" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" target="_blank" class="newsletter-form">
          <div id="mc_embed_signup_scroll">
            <div class="newsletter-form__content">
              <input type="email" placeholder="me@example.com" value="" name="EMAIL" id="mce-EMAIL" required class="newsletter-form__input"/>
              <button type="submit" name="subscribe" id="mc-embedded-subscribe" class="cta-button" style="height: 3rem;">Subscribe</button>
            </div>
            <div id="mce-responses" class="clear">
              <div class="response" id="mce-error-response" style="display:none"></div>
              <div class="response" id="mce-success-response" style="display:none"></div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>

{% endblock content %}