Skip to content

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

License

Notifications You must be signed in to change notification settings

musicinmybrain/sure

This branch is 1 commit ahead of, 30 commits behind gabrielfalcao/sure:master.

Folders and files

NameName
Last commit message
Last commit date
Dec 18, 2023
Feb 5, 2023
Dec 20, 2023
Dec 20, 2023
Oct 17, 2016
May 16, 2018
Nov 3, 2022
Feb 6, 2023
Jun 21, 2021
Nov 3, 2022
Jun 29, 2016
Feb 6, 2023
Feb 5, 2023
Jan 25, 2020
Jun 21, 2021
Mar 23, 2017
Dec 20, 2019
Jun 21, 2021
Jun 21, 2021
Dec 20, 2023
Dec 20, 2023

Repository files navigation

sure

https://img.shields.io/pypi/dm/sure https://img.shields.io/readthedocs/sure https://img.shields.io/github/license/gabrielfalcao/sure?label=Github%20License https://img.shields.io/pypi/v/sure https://img.shields.io/pypi/l/sure?label=PyPi%20License https://img.shields.io/pypi/format/sure https://img.shields.io/pypi/status/sure https://img.shields.io/pypi/pyversions/sure https://img.shields.io/pypi/implementation/sure https://img.shields.io/github/v/tag/gabrielfalcao/sure

An idiomatic testing library for python with powerful and flexible assertions, created by Gabriel Falcão. Sure's developer experience is inspired and modeled after 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 by RSpec Expectations and should.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 96.0%
  • Makefile 2.6%
  • Shell 1.4%