Is there a python equivalent for RSpec to do TDD? Is there a python equivalent for RSpec to do TDD? ruby ruby

Is there a python equivalent for RSpec to do TDD?


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


I love Rspec! On python, I am going to use a py.test plugin called spec: https://pypi.python.org/pypi/pytest-spechttps://github.com/pchomik/pytest-spec

It uses unittest, the default python package, plus pytest and itself. Upon cloning the project to my python 2.7 conda OSX 10.11 installation, I was able to run its own tests, and it worked fine!

The format is simple, but it includes the basics: a group name, the pass/fail/skip status, and the name of the test spelled out with spaces instead of underscores. Here's some output from their own tests, which seem simple for me to follow on my own.

    $ py.test --spec================================ test session starts =================================platform darwin -- Python 2.7.11, pytest-2.9.2, py-1.4.31, pluggy-0.3.1rootdir: /Users/ME/src/pytestspec, inifile: setup.cfgplugins: spec-1.0.1, testinfra-1.4.1collected 30 items test/test_patch.py::TestPatch    [PASS]  Pytest runtest logreport honors capitalization of words in test name    [PASS]  Pytest runtest logreport marks method marked by double underscores    [PASS]  Pytest runtest logreport prints class name before first test result    [PASS]  Pytest runtest logreport prints test name and failed status    [PASS]  Pytest runtest logreport prints test name and handle only single marker    [PASS]  Pytest runtest logreport prints test name and passed status    [PASS]  Pytest runtest logreport prints test name and skipped status    [PASS]  Pytest runtest logreport returns none when letter is missing    [PASS]  Pytest runtest logreport returns none when nodeid is wrong formatted    [PASS]  Pytest runtest logreport returns none when word is missing    [PASS]  Pytest runtest logreport skips empty line for first test    [PASS]  Pytest runtest logstart returns nonetest/test_plugin.py::TestPlugin    [PASS]  Pytest adoption adds spec option    [PASS]  Pytest adoption gets general group    [PASS]  Pytest configure reloads pytest after patching    [PASS]  Pytest configure should not reload configurationtest/test_replacer.py::TestPatcher    [PASS]  Logstart replacer returns result of pytest runtest logstart method    [PASS]  Report replacer returns result of pytest runtest logreport methodtest/test_formats/test_functions.py    [PASS]  Some function returns none    [PASS]  Some function single underscore as prefix    [PASS]  Some function single underscore as suffixtest/test_formats/test_methods.py::TestFormats    [PASS]  Some method returns none    [PASS]  Some method single underscore as suffix    [PASS]  Some method single underscore as prefixtest/test_results/test_as_class.py::TestResults    [SKIP]  Some method return none    [SKIP]  Some method returns false    [PASS]  Some method returns truetest/test_results/test_as_functions.py    [PASS]  Some method returns true    [SKIP]  Some method returns false    [SKIP]  Some method return none======================== 26 passed, 4 skipped in 0.14 seconds ========================


http://pythonhosted.org/behave/

This is one solution to behavior driven development in python. Might help.