{ "info": { "author": "Michael Boulton", "author_email": "boulton@zoetrope.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Pytest", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Testing", "Topic :: Utilities" ], "description": ".. image:: https://travis-ci.org/taverntesting/tavern.svg?branch=master\n :target: https://travis-ci.org/taverntesting/tavern\n\n.. image:: https://img.shields.io/pypi/v/tavern.svg\n :target: https://pypi.org/project/tavern/\n\n.. image:: https://readthedocs.org/projects/pip/badge/?version=latest&style=flat\n :target: https://tavern.readthedocs.io/en/latest/\n\nEasier API testing\n==================\n\nTavern is a pytest plugin, command-line tool and Python library for\nautomated testing of APIs, with a simple, concise and flexible\nYAML-based syntax. It's very simple to get started, and highly\ncustomisable for complex tests. Tavern supports testing RESTful APIs as\nwell as MQTT based APIs.\n\nThe best way to use Tavern is with\n`pytest `__. Tavern comes with a\npytest plugin so that literally all you have to do is install pytest and\nTavern, write your tests in ``.tavern.yaml`` files and run pytest. This\nmeans you get access to all of the pytest ecosystem and allows you to do\nall sorts of things like regularly run your tests against a test server\nand report failures or generate HTML reports.\n\nYou can also integrate Tavern into your own test framework or continuous\nintegration setup using the Python library, or use the command line\ntool, ``tavern-ci`` with bash scripts and cron jobs.\n\nTo learn more, check out the `examples `__ or the complete\n`documentation `__. If you're interested in contributing\nto the project take a look at the `GitHub\nrepo `__.\n\nFor GRPC usage take a look at `PR#438 `__.\n\nQuickstart\n----------\n\nFirst up run ``pip install tavern``.\n\nThen, let's create a basic test, ``test_minimal.tavern.yaml``:\n\n.. code:: yaml\n\n ---\n # Every test file has one or more tests...\n test_name: Get some fake data from the JSON placeholder API\n\n # ...and each test has one or more stages (e.g. an HTTP request)\n stages:\n - name: Make sure we have the right ID\n\n # Define the request to be made...\n request:\n url: https://jsonplaceholder.typicode.com/posts/1\n method: GET\n\n # ...and the expected response code and body\n response:\n status_code: 200\n body:\n id: 1\n\nThis file can have any name, but if you intend to use Pytest with\nTavern, it will only pick up files called ``test_*.tavern.yaml``.\n\nThis can then be run like so:\n\n.. code:: bash\n\n $ pip install tavern[pytest]\n $ py.test test_minimal.tavern.yaml -v\n =================================== test session starts ===================================\n platform linux -- Python 3.5.2, pytest-3.4.2, py-1.5.2, pluggy-0.6.0 -- /home/taverntester/.virtualenvs/tavernexample/bin/python3\n cachedir: .pytest_cache\n rootdir: /home/taverntester/myproject, inifile:\n plugins: tavern-0.7.2\n collected 1 item\n\n test_minimal.tavern.yaml::Get some fake data from the JSON placeholder API PASSED [100%]\n\n ================================ 1 passed in 0.14 seconds =================================\n\nIt is strongly advised that you use Tavern with Pytest - not only does\nit have a lot of utility to control discovery and execution of tests,\nthere are a huge amount of plugins to improve your development\nexperience. If you absolutely can't use Pytest for some reason, use the\n``tavern-ci`` command line interface:\n\n.. code:: bash\n\n $ pip install tavern\n $ tavern-ci --stdout test_minimal.tavern.yaml\n 2017-11-08 16:17:00,152 [INFO]: (tavern.core:55) Running test : Get some fake data from the JSON placeholder API\n 2017-11-08 16:17:00,153 [INFO]: (tavern.core:69) Running stage : Make sure we have the right ID\n 2017-11-08 16:17:00,239 [INFO]: (tavern.core:73) Response: '' ({\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"sunt aut facere repellat provident occaecati excepturi optio reprehenderit\",\n \"body\": \"quia et suscipit\\nsuscipit recusandae consequuntur expedita et cum\\nreprehenderit molestiae ut ut quas totam\\nnostrum rerum est autem sunt rem eveniet architecto\"\n })\n 2017-11-08 16:17:00,239 [INFO]: (tavern.printer:9) PASSED: Make sure we have the right ID [200]\n\nWhy not Postman, Insomnia or pyresttest etc?\n--------------------------------------------\n\nTavern is a focused tool which does one thing well: automated testing of\nAPIs.\n\n**Postman** and **Insomnia** are excellent tools which cover a wide\nrange of use-cases for RESTful APIs, and indeed we use Tavern alongside\nPostman. However, specifically with regards to automated testing, Tavern\nhas several advantages over Postman: - A full-featured Python\nenvironment for writing easily reusable custom validation functions -\nTesting of MQTT based systems in tandem with RESTful APIS. - Seamless\nintegration with pytest to keep all your tests in one place - A simpler,\nless verbose and clearer testing language\n\nTavern does not do many of the things Postman and Insomnia do. For\nexample, Tavern does not have a GUI nor does it do API monitoring or\nmock servers. On the other hand, Tavern is free and open-source and is a\nmore powerful tool for developers to automate tests.\n\n**pyresttest** is a similar tool to Tavern for testing RESTful APIs, but\nis no longer actively developed. On top of MQTT testing, Tavern has\nseveral other advantages over PyRestTest which overall add up to a\nbetter developer experience:\n\n- Cleaner test syntax which is more intuitive, especially for\n non-developers\n- Validation function are more flexible and easier to use\n- Better explanations of why a test failed\n\nHacking on Tavern\n-----------------\n\nIf you want to add a feature to Tavern or just play around with it\nlocally, it's a good plan to first create a local development\nenvironment (`this\npage `__ has a\ngood primer for working with development environments with Python).\nAfter you've created your development environment, just\n``pip install tox`` and run ``tox`` to run the unit tests. If you want\nto run the integration tests, make sure you have\n`docker `__ installed and run\n``tox -c tox-integration.ini`` (bear in mind this might take a while.)\nIt's that simple!\n\nIf you want to develop things in tavern, enter your virtualenv and run\n``pip install -r requirements.txt`` to install the library, any requirements,\nand other useful development options.\n\nTavern uses [black](https://github.com/ambv/black) to keep all of the code\nformatted consistently. There is a pre-commit hook to run black which can\nbe enabled by running ``pre-commit install``.\n\nIf you want to add a feature to get merged back into mainline Tavern:\n\n- Add the feature you want\n- Add some tests for your feature:\n - If you are adding some utility functionality such as improving verification\n of responses, adding some unit tests might be best. These are in the\n ``tests/unit/`` folder and are written using Pytest.\n - If you are adding more advanced functionality like extra validation\n functions, or some functionality that directly depends on the format of the\n input YAML, it might also be useful to add some integration tests. At the\n time of writing, this is done by adding an example flask endpoint in\n ``tests/integration/server.py`` and a corresponding Tavern YAML test file in\n the same directory. This will be cleaned up a bit once we have a proper\n plugin system implemented.\n- Open a `pull request `__.\n\nNote that Tavern supports Python 2.7 (for the time being), so any code\nyou add has to be compatible with it. We currently use the\n`future `__ library to provide\nbackwards compatibility.\n\nAcknowledgements\n----------------\n\nTavern makes use of several excellent open-source projects:\n\n- `pytest `__, the testing\n framework Tavern intergrates with\n- `requests `__, for HTTP\n requests\n- `YAML `__ and\n `pyyaml `__, for the test syntax\n- `pykwalify `__, for YAML schema\n validation\n- `pyjwt `__, for decoding JSON Web\n Tokens\n- `colorlog `__, for\n formatting terminal outputs\n- `paho-mqtt `__, for\n sending MQTT messages\n\n\nMaintenance\n-----------\n\nTavern is currently maintained by\n\n- @michaelboulton\n- @benhowes", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://taverntesting.github.io/", "keywords": "testing,pytest", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "tavern-grpc", "package_url": "https://pypi.org/project/tavern-grpc/", "platform": "", "project_url": "https://pypi.org/project/tavern-grpc/", "project_urls": { "Homepage": "https://taverntesting.github.io/" }, "release_url": "https://pypi.org/project/tavern-grpc/0.30.11/", "requires_dist": null, "requires_python": "", "summary": "Simple testing of RESTful APIs", "version": "0.30.11" }, "last_serial": 5814554, "releases": { "0.30.0": [ { "comment_text": "", "digests": { "md5": "ab784a3f186926ffceeffd5d3fac6e9a", "sha256": "c85576ce081f1b47a7211fbbc1207e91fca98195b0d9c55105ecf1507302b281" }, "downloads": -1, "filename": "tavern-grpc-0.30.0.tar.gz", "has_sig": false, "md5_digest": "ab784a3f186926ffceeffd5d3fac6e9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 61461, "upload_time": "2019-09-09T11:13:55", "url": "https://files.pythonhosted.org/packages/fb/14/c8d8c13d52a555860dfeaf861a30e0320a947d73920d1a5ec3e6e1367b66/tavern-grpc-0.30.0.tar.gz" } ], "0.30.1": [ { "comment_text": "", "digests": { "md5": "1c9436c6e34e30e10ade1ef3c6d0d2a2", "sha256": "6fe910beb95324d001df04b1988779b33f37bdd96aa2e61d45f6c8cb719d4987" }, "downloads": -1, "filename": "tavern-grpc-0.30.1.tar.gz", "has_sig": false, "md5_digest": "1c9436c6e34e30e10ade1ef3c6d0d2a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 61495, "upload_time": "2019-09-11T08:41:42", "url": "https://files.pythonhosted.org/packages/55/62/521577519b6f215f176eeed68943c0f0fa753736e1eb91783809185c85e2/tavern-grpc-0.30.1.tar.gz" } ], "0.30.11": [ { "comment_text": "", "digests": { "md5": "8f13b3ee7a0a25a2194aab7a04ec2dd9", "sha256": "dadb6340e0041bb8ee26e5a079eb3f92457fac4f72d315a727e4647cb0845300" }, "downloads": -1, "filename": "tavern-grpc-0.30.11.tar.gz", "has_sig": false, "md5_digest": "8f13b3ee7a0a25a2194aab7a04ec2dd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 61560, "upload_time": "2019-09-11T12:15:08", "url": "https://files.pythonhosted.org/packages/3f/d0/4bd83cedce7e182b2af0d6e45b4d1b5aa3f284dcc2db0682f74a9814914e/tavern-grpc-0.30.11.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8f13b3ee7a0a25a2194aab7a04ec2dd9", "sha256": "dadb6340e0041bb8ee26e5a079eb3f92457fac4f72d315a727e4647cb0845300" }, "downloads": -1, "filename": "tavern-grpc-0.30.11.tar.gz", "has_sig": false, "md5_digest": "8f13b3ee7a0a25a2194aab7a04ec2dd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 61560, "upload_time": "2019-09-11T12:15:08", "url": "https://files.pythonhosted.org/packages/3f/d0/4bd83cedce7e182b2af0d6e45b4d1b5aa3f284dcc2db0682f74a9814914e/tavern-grpc-0.30.11.tar.gz" } ] }