On 12/08/2011 08:30 AM, Jacek Generowicz wrote:
> Hi,
> 
> 
> QuickCheck is a property-based testing framework originating in  
> Haskell. Its 3 key concepts are:
> 
> 1. Tests are expressed as properties: invariants which should be  
> satisfied for any appropriate test data.
> 
> 2. The test data are randomly generated and fed to the property.
> 
> 3. (this is the really interesting stroke of genius) When some data  
> are found for which the test fails, QuickCheck attempts to simplify  
> the data to obtain the minimal example that still fails.
> 
> 
> My questions are:
> 
> 1. Are you aware of any work being done on integrating the QuickCheck  
> idea with pytest?
so far there is no direct work being done
the generate_tests hooks and parametrize are going into something that
could be a good base for approaching randomized test generators

> 
> 2. QuickCheck generates new test invocations in response to failing  
> tests; Pytest collects tests *before* they are run. Would these two  
> seemingly conflicting features prose problems in trying to implement a  
> QuickCheck plugin for pytest?

pytest itself has a strict collect first, run then model
however i think it might make sense to extend the looponfail mode of the
xdist plugin

the basic idea is that the next batch fo generated items would be
executed in the next looponfail iteration

i don't know how well this can sit with the design of xdist/looponfail,
but it seems doable to have it collect new items for generative functions


> 
> 3. Would you have any general advice on how one might approach  
> providing a QuickCheck clone on top of pytest?
> 

* start with a library that can simply generate those randomized values
  -> instantly usable with parametrize+generate_tests
* continue extending it with creating simplifications
* extend reports with extra data about
* teach the looponfail runner to generate different items based on
failure (you

btw, it would be nice if there was some basic way to recreate a test
with the same conditions based on some kind of id/identification

best regards,
Ronny Pfannschmidt

> 
> Thanks.
> 
> _______________________________________________
> py-dev mailing list
> py-dev@codespeak.net
> http://codespeak.net/mailman/listinfo/py-dev


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
py-dev mailing list
py-dev@codespeak.net
http://codespeak.net/mailman/listinfo/py-dev

Reply via email to