Skip to content

Instantly share code, notes, and snippets.

@raiderrobert
Last active May 12, 2016 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raiderrobert/db4a4cba95f1d527e48690095e6ba763 to your computer and use it in GitHub Desktop.
Save raiderrobert/db4a4cba95f1d527e48690095e6ba763 to your computer and use it in GitHub Desktop.
Why hypothesis is awesome
import unittest
class ActiveTests(TestCase):
def test_upper(self):
self.assertEqual('foo'.upper(), 'FOO')
import unittest
from hypothesis import given
from hypothesis.strategies import text
class ActiveTests(TestCase):
@given(text=text())
def test_upper(self, text):
upper_case_text = text.upper()
self.assertTrue(upper_case_text.isupper())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment