{ "info": { "author": "Tim Cuthbertson", "author_email": "tim3d.junk+pea@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Testing" ], "description": ".. image:: http://gfxmonk.net/dist/status/project/pea.png\r\n\r\n\r\npea - The tiniest green vegetable.\r\n-------------------------------------\r\n\r\n**pea** is a minimal BDD framework for python, in the style of ruby's `cucumber`_ and\r\npython's `lettuce`_. It aims to help you write the same kind of tests - but in straight-up\r\npython code, without all the parsing and indirection and other hoops to jump through. It's\r\na lot like ruby's `coulda`_.\r\n\r\nBenefits of cucumber-style testing include:\r\n\r\n- You write your tests in clear, english language without inline code\r\n- Your tests are human-readable, and hopefully human-editable\r\n- You can re-use steps with confidence, because they all do exactly what\r\n they say on the tin\r\n\r\nBenefits of ``pea`` over ``lettuce``, ``cucumber``, etc:\r\n\r\n- It's a really trivial library (thus the name). It doesn't do very much,\r\n so it probably doesn't have many bugs\r\n \r\n- Your features are just python code:\r\n \r\n - No \"BDD language parser\" needed\r\n - No regular expressions\r\n - Stack traces make sense\r\n - Syntax highlighting\r\n - You can use `ctags`_ to jump between test & implementation, as well as\r\n for method completion\r\n - Managing and renaming functions is much easier than managing regexes\r\n - You can use whatever abstractions you like\r\n - You can use rich python objects as arguments, instead of parsing strings\r\n \r\n- It doesn't need its own test runner; so you can just use `nose`_ to run it\r\n alongside your unit tests\r\n\r\n\r\nSo how do I use it?\r\n--------------------------------------\r\n\r\nHere's a minimal example::\r\n\r\n\tfrom pea import *\r\n\r\n\t@step\r\n\tdef I_go_to_the_store():\r\n\t\tworld.location='store'\r\n\t\tworld.cart = []\r\n\t\r\n\t@step\r\n\tdef I_buy_some(item):\r\n\t\tworld.cart.append(item)\r\n\r\n\t@step\r\n\tdef I_go_home():\r\n\t\tworld.location = 'home'\r\n\t\r\n\t@step\r\n\tdef I_have_some_delicious(item):\r\n\t\tassert item in world.cart\r\n\t\tworld.assertEquals(world.location, 'home')\r\n\r\n\t# --------------------\r\n\r\n\tclass TestShopping(TestCase):\r\n\t\tdef test_buying_some_peas(self):\r\n\t\t\t\r\n\t\t\tGiven.I_go_to_the_store()\r\n\t\t\tWhen.I_buy_some('peas')\r\n\t\t\tAnd.I_go_home()\r\n\t\t\tThen.I_have_some_delicious('peas')\r\n\r\n... and when you run it (with nosetests, in verbose mode):\r\n\r\n.. image:: http://gfxmonk.net/dist/0install/impl/pea/screenshot.png\r\n\r\nTypically you would put your steps in a separate python module (or many),\r\nbut it's your choice.\r\n\r\nBasics:\r\n^^^^^^^\r\n\r\n- ``@step`` adds your function to pea's registry of steps, which allows\r\n them to be called via ``Given``, ``When``, ``And``, and ``Then``.\r\n- To re-use a step from inside another step, just call the function!\r\n\r\nStuff to remember:\r\n^^^^^^^^^^^^^^^^^^\r\n- Make sure you inherit from ``pea.TestCase`` (and call ``super`` from ``setUp``/``tearDown``),\r\n as it takes care of resetting the ``world`` between tests.\r\n- You can use ``TestCase`` assertion methods on the world, too\r\n - e.g. ``world.assertEquals(expected, actual)``\r\n\r\nPea works well with `rednose`_\r\n\r\n.. _cucumber: http://cukes.info/\r\n.. _coulda: https://github.com/elight/coulda\r\n.. _lettuce: https://github.com/gabrielfalcao/lettuce/\r\n.. _ctags: http://ctags.sourceforge.net/\r\n.. _nose: http://somethingaboutorange.com/mrl/projects/nose/1.0.0/\r\n.. _rednose: https://github.com/gfxmonk/rednose/tree", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/gfxmonk/pea/tree", "keywords": "test nosetests nose nosetest bdd cucumber lettuce", "license": "UNKNOWN", "maintainer": "", "maintainer_email": "", "name": "pea", "package_url": "https://pypi.org/project/pea/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pea/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/gfxmonk/pea/tree" }, "release_url": "https://pypi.org/project/pea/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "minimal BDD library", "version": "0.1.2" }, "last_serial": 2067230, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "2a28cd468f24c508f3a12e3f9ccc83a1", "sha256": "caefe61837130ca13bdfe4b8443c03912685808dae60d46ca925168c72d47827" }, "downloads": -1, "filename": "pea-0.1.tar.gz", "has_sig": false, "md5_digest": "2a28cd468f24c508f3a12e3f9ccc83a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2398, "upload_time": "2011-01-29T08:26:15", "url": "https://files.pythonhosted.org/packages/af/a7/543c954e08bf08fcc91f0de8c2c0cbf5d149b3f6a72722e71273a284cb2c/pea-0.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "ee92248f3d76b0622eca6af0d53e438d", "sha256": "7a8501c07353eab0ba1c7207302f5fb63122312b5a02fa267dd500faa4e453bf" }, "downloads": -1, "filename": "pea-0.1.2.tar.gz", "has_sig": false, "md5_digest": "ee92248f3d76b0622eca6af0d53e438d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6835, "upload_time": "2015-08-25T11:45:29", "url": "https://files.pythonhosted.org/packages/ea/ff/7ed8d00702e875abc29dbf90808359bb6830532593415c2c937bb024051f/pea-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ee92248f3d76b0622eca6af0d53e438d", "sha256": "7a8501c07353eab0ba1c7207302f5fb63122312b5a02fa267dd500faa4e453bf" }, "downloads": -1, "filename": "pea-0.1.2.tar.gz", "has_sig": false, "md5_digest": "ee92248f3d76b0622eca6af0d53e438d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6835, "upload_time": "2015-08-25T11:45:29", "url": "https://files.pythonhosted.org/packages/ea/ff/7ed8d00702e875abc29dbf90808359bb6830532593415c2c937bb024051f/pea-0.1.2.tar.gz" } ] }