+ All Categories
Home > Technology > Hypothesis randomised testing for django

Hypothesis randomised testing for django

Date post: 13-Apr-2017
Category:
Upload: leo-zhou
View: 260 times
Download: 3 times
Share this document with a friend
29
Hypothesis Randomised testing for Django Rae Knowler, DjangoCon Europe 2015
Transcript
Page 1: Hypothesis randomised testing for django

HypothesisRandomised testing for DjangoRae Knowler, DjangoCon Europe 2015

Page 2: Hypothesis randomised testing for django

Introduction

Page 3: Hypothesis randomised testing for django

Rae Knowler

CKAN, Symfony, Django@RaeKnowlerthey/their/them

Page 5: Hypothesis randomised testing for django

Hypothesis

Property based testing libraryInspired by Haskell’s Quickcheck

http://hypothesis.readthedocs.org

Page 6: Hypothesis randomised testing for django

Hypothesis

Page 7: Hypothesis randomised testing for django

Why is it so great?

Page 8: Hypothesis randomised testing for django

Why is it so great?

● Lots of randomised data

Page 9: Hypothesis randomised testing for django

Why is it so great?

● Lots of randomised data● Simplifies examples

Page 10: Hypothesis randomised testing for django

Why is it so great?

● Lots of randomised data● Simplifies examples● Remembers interesting inputs

Page 11: Hypothesis randomised testing for django

Why is it so great?

● Lots of randomised data● Simplifies examples● Remembers interesting inputs● Can deal with complex data types

Page 12: Hypothesis randomised testing for django

Why is it so great?

● Lots of randomised data● Simplifies examples● Remembers interesting inputs● Can deal with complex data types● Works with pytest and unittest

Page 13: Hypothesis randomised testing for django

Hypothesis + Django

Page 14: Hypothesis randomised testing for django

hypothesis-django

Page 15: Hypothesis randomised testing for django

hypothesis-django

● Custom field types

Page 16: Hypothesis randomised testing for django

hypothesis-django

● Custom field types● Generate child models

Page 17: Hypothesis randomised testing for django

hypothesis-django

● Custom field types● Generate child models● Fixtures (new!)

Page 18: Hypothesis randomised testing for django

Getting started

Page 19: Hypothesis randomised testing for django

Install

pip install hypothesis

pip install hypothesis-django

Page 20: Hypothesis randomised testing for django

Demo

Page 21: Hypothesis randomised testing for django
Page 22: Hypothesis randomised testing for django
Page 23: Hypothesis randomised testing for django
Page 24: Hypothesis randomised testing for django
Page 25: Hypothesis randomised testing for django
Page 26: Hypothesis randomised testing for django
Page 27: Hypothesis randomised testing for django

Summary

Page 29: Hypothesis randomised testing for django

Thank you!


Recommended