Last active
May 12, 2016 02:37
-
-
Save raiderrobert/db4a4cba95f1d527e48690095e6ba763 to your computer and use it in GitHub Desktop.
Why hypothesis is awesome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
class ActiveTests(TestCase): | |
def test_upper(self): | |
self.assertEqual('foo'.upper(), 'FOO') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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