#!/usr/bin/env python3 # -*- coding: utf-8 -*- from hypothesis import assume, given from hypothesis.strategies import characters, text from unittest import main, TestCase def some_function(input_string: str) -> bool: for character in input_string: if character == 'c': raise RuntimeError('Bug with letter ā€œcā€ in third position.') return True def some_other_function(input_string: str) -> bool: if input_string[0] == 'a': return False return True class SomeTest(TestCase): @given(input_string=text()) def test_some_function(self, input_string): assert(some_function(input_string) == True) @given(input_string=text()) def test_some_other_function(self, input_string): assume(input_string is not 'a') assert(some_other_function(input_string) == True) if __name__ == '__main__': main()