Awesome Open Source
Awesome Open Source

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

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


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Python (1,126,520
Hacktoberfest (22,824
Testing (6,233
Tdd (1,507
Unittest (946
Specification (493
Test Framework (386
Related Projects