Skip to content
/ sure Public
forked from gabrielfalcao/sure

idiomatic assertion toolkit with human-friendly failure messages, inspired on RSpec Expectations and should.js

License

Notifications You must be signed in to change notification settings

tirkarthi/sure

 
 

Repository files navigation

sure

image

image

image

image

image

image

image

image

image

image

image

image

An idiomatic testing library for python with powerful and flexible assertions. Sure is heavily inspired in RSpec Expectations and should.js

Installing

$ pip install sure

Documentation

Available in the website or under the docs directory.

You can also build the documentation locally using sphinx:

make docs

Here is a tease

Equality

(number).should.equal(number)

import sure

(4).should.be.equal(2 + 2)
(7.5).should.eql(3.5 + 4)

(3).shouldnt.be.equal(5)

Assert dictionary and its contents

{'foo': 'bar'}.should.equal({'foo': 'bar'})
{'foo': 'bar'}.should.have.key('foo').which.should.equal('bar')

"A string".lower().should.equal("a string") also works

"Awesome ASSERTIONS".lower().split().should.equal(['awesome', 'assertions'])

About

idiomatic assertion toolkit with human-friendly failure messages, inspired on RSpec Expectations and should.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.3%
  • Makefile 0.7%