Git Product home page Git Product logo

nimoy's Introduction

Nimoy

A testing and specification framework for Python 3, heavily inspired by the amazing Spock Framework.

PyPI version CircleCI

Better Python Testing

Powerful Python DDT (Domain Driven Testing) made easy with Nimoy’s DSL:

from nimoy.specification import Specification

class MySpec(Specification):

    def my_feature_method(self):
        with given:
            a = value_of_a
            b = value_of_b

        with expect:
            (a * b) == expected_value

        with where:
            value_of_a | value_of_b | expected_value
            1          | 10         | 10
            2          | 20         | 40

Installation

Python 3.8 or earlier

pip install nimoy-framework==1.0.2

Python 3.9 or later

pip install nimoy-framework

Why?

The Spock Framework has set a new standard as to what testing frameworks should be like - beautiful, expressive, pragmatic and fun.

While unittest, pytest and nose2 are great, there’s still room for improvement.

The aim of this project is to port Spock to Python while maintaining the original vision as much as possible.

Features

  • Domain Driven Testing

  • Based on unittest, so minimal dependencies are required and specifications are recognized by IDEs and report analyzers.

  • Reduction of boilerplate code.

  • Write detailed specifications with clear distinction.

  • Auto discovery of specifications.

  • Write data-driven specifications.

  • Pretty mock behavior assertion.

  • See fancy detailed assertion failure reports including power assertions.

License

Apache License 2.0

In memory of Leonard Nimoy 1931-2015

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.