{% 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 %}
