News for hackers. Stuff that matters.
Re:Show HN: Python Tests That Write Themselves by timothycrosley on Wednesday September 18, 2019 @01:37PM (#21007826)
By default, the biggest value from this is catching unexpected runtime exceptions with certain values (the edge cases you don't think of yourself). To get the most value out of it, you can further specify what you expect from the result using the _auto_verify=Callable() parameter, or by looking at the individual test cases.

Simple example:

  from my_library import add
  from hypothesis_auto import auto_pytest

  @auto_pytest()
  def test_add(test_case):
     add_result = test_case() 
     if test_case.params.kwargs['number_1'] > 0 and test_case.params.kwargs['number_1']:
         assert add_result > test_case.params.kwargs['number_1']
         assert add_result > test_case.params.kwargs['number_1']
Re:Show HN: Python Tests That Write Themselves by ebg13 on Wednesday September 18, 2019 @02:12PM (#21008249)
> By default, the biggest value from this is catching unexpected runtime exceptions with certain values (the edge cases you don't think of yourself).

So it's a fuzzer?

Re:Show HN: Python Tests That Write Themselves by timothycrosley on Wednesday September 18, 2019 @02:15PM (#21008292)
Yes! A smart one though, that limits itself to the type constraints you've specified to avoid redoing the work of your type checker.