Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a python equivalent for RSpec to do TDD?

I'm looking for a test framework like Ruby's RSpec to do test driven development in Python. The advantage of a framework like RSpec is that it offers a DSL that lends itself well to TDD. First you describe the test in english, and then you write the test, and when it fails you get a message saying what test failed with your nice description of what the test is trying to do.

So far I've looked at PyTest and Nose. PyTest seems closer to ruby's MiniTest than RSpec. Instead of offering a DSL with language to make it read like specifications, it focuses on assertions. Nose seems like a wrapper on PyTest that doesn't add its own DSL.

Is there another option I'm missing? Or am I just misusing PyTest and Nose? Has the Python community settled on some totally different way of doing this and I should stop trying to make it like Ruby? It doesn't seem, based on the number of stars on GitHub, that the community has really anointed either of these options as the preferred testing framework.

like image 923
williamcodes Avatar asked May 19 '16 21:05

williamcodes


People also ask

Is RSpec a framework?

RSpec is a computer domain-specific language (DSL) (particular application domain) testing tool written in the programming language Ruby to test Ruby code. It is a behavior-driven development (BDD) framework which is extensively used in production applications.

What is RSpec testing?

RSpec is a testing tool for Ruby, created for behavior-driven development (BDD). It is the most frequently used testing library for Ruby in production applications. Even though it has a very rich and powerful DSL (domain-specific language), at its core it is a simple tool which you can start using rather quickly.


1 Answers

The closest I have come to doing a brief google search was mamba + expects:

  • mamba: https://github.com/nestorsalceda/mamba
  • expects: https://github.com/jaimegildesagredo/expects
like image 101
Torben Knerr Avatar answered Sep 24 '22 01:09

Torben Knerr