{ "info": { "author": "Vasily Kuznetsov", "author_email": "kvas.it@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Pytest", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Testing" ], "description": "pytest-console-scripts\n===================================\n\n.. image:: https://travis-ci.org/kvas-it/pytest-console-scripts.svg?branch=master\n :target: https://travis-ci.org/kvas-it/pytest-console-scripts\n :alt: See Build Status on Travis CI\n\nPytest-console-scripts is a `Pytest`_ plugin for testing python scripts\ninstalled via ``console_scripts`` entry point of ``setup.py``. It can run the\nscripts under test in a separate process or using the interpreter that's\nrunning the test suite. The former mode ensures that the script will run in an\nenvironment that is identical to normal execution whereas the latter one allows\nmuch quicker test runs during development while simulating the real runs as\nmuch as possible.\n\n\nRequirements\n------------\n\n* Python 2.7 or 3.4+, or PyPy,\n* Pytest 4.0 or newer.\n\n\nInstallation\n------------\n\nYou can install \"pytest-console-scripts\" via `pip`_ from `PyPI`_::\n\n $ pip install pytest-console-scripts\n\n\nUsage\n-----\n\nImagine we have a python package ``foo`` with the following ``setup.py``:\n\n.. code-block:: python\n\n setup(\n name='foo',\n version='0.0.1',\n py_modules=['foo'],\n entry_points={\n 'console_scripts': ['foobar=foo:bar']\n },\n )\n\nWe could use pytest-console-scripts to test the ``foobar`` script:\n\n.. code-block:: python\n\n def test_foo_bar(script_runner):\n ret = script_runner.run('foobar', '--version')\n assert ret.success\n # just for example, let's assume that foobar --version \n # should output 3.2.1\n assert ret.stdout == '3.2.1\\n'\n assert ret.stderr == ''\n\nThis would use the ``script_runner`` fixture provided by the plugin to\nrun the script and capture it's output.\n\nThe arguments of ``script_runner.run`` are the command name of the script and\nany command line arguments that should be passed to it. Additionally the\nfollowing keyword arguments can be used:\n\n- ``cwd`` - set the working directory of the script under test.\n- ``stdin`` - a file-like object that will be piped to standard input of the\n script.\n\nConfiguring script execution mode\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIn the example above the ``foobar`` script would run in in-process mode. This\nis fast and good for quick iteration during development. After we're happy with\nthe functionality, it's time to run the script in subprocess mode to simulate\nreal invocation more closely. There are several ways to do this. We can\nconfigure it via pytest configuration (for example in ``tox.ini``):\n\n.. code-block:: ini\n\n [pytest]\n script_launch_mode = subprocess\n\nWe can give a command line option to pytest (this will override the\nconfiguration file)::\n\n $ py.test --script-launch-mode=subprocess test_foobar.py\n\nWe can also mark individual tests to run in a specific mode:\n\n.. code-block:: python\n\n @pytest.mark.script_launch_mode('subprocess')\n def test_foobar(script_runner):\n ...\n\nBetween these three methods the marking of the tests has priority before the\ncommand line option that in turn overrides the configuration setting. All three\ncan take three possible values: \"inprocess\" (which is the default),\n\"subprocess\", and \"both\" (which will cause the test to be run twice: in\ninprocess and in subprocess modes).\n\n\nContributing\n------------\nContributions are very welcome. Tests can be run with `tox`_, please ensure\nthe coverage at least stays the same before you submit a pull request.\n\n\nLicense\n-------\n\nDistributed under the terms of the `MIT`_ license, \"pytest-console-scripts\"\nis free and open source software.\n\n\nIssues\n------\n\nIf you encounter any problems, please `file an issue`_ along with a detailed\ndescription.\n\n\n----\n\nPytest-console-scripts was initially generated with `Cookiecutter`_ along with\n`@hackebrot`_'s `Cookiecutter-pytest-plugin`_ template.\n\n.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter\n.. _`@hackebrot`: https://github.com/hackebrot\n.. _`MIT`: http://opensource.org/licenses/MIT\n.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin\n.. _`file an issue`: https://github.com/kvas-it/pytest-console-scripts/issues\n.. _`pytest`: https://github.com/pytest-dev/pytest\n.. _`tox`: https://tox.readthedocs.org/en/latest/\n.. _`pip`: https://pypi.python.org/pypi/pip/\n.. _`PyPI`: https://pypi.python.org/pypi", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kvas-it/pytest-console-scripts", "keywords": "", "license": "MIT", "maintainer": "Vasily Kuznetsov", "maintainer_email": "kvas.it@gmail.com", "name": "pytest-console-scripts", "package_url": "https://pypi.org/project/pytest-console-scripts/", "platform": "", "project_url": "https://pypi.org/project/pytest-console-scripts/", "project_urls": { "Homepage": "https://github.com/kvas-it/pytest-console-scripts" }, "release_url": "https://pypi.org/project/pytest-console-scripts/0.1.10/", "requires_dist": null, "requires_python": "", "summary": "Pytest plugin for testing console scripts", "version": "0.1.10" }, "last_serial": 5808970, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "01f298afebb0761f5e6189ae9c5c0eb0", "sha256": "eb7b229c43be9a35fe7a6d74b17bead0032df128f91550684c05a0d5b890f0c3" }, "downloads": -1, "filename": "pytest-console-scripts-0.1.0.tar.gz", "has_sig": false, "md5_digest": "01f298afebb0761f5e6189ae9c5c0eb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4934, "upload_time": "2016-10-27T10:18:20", "url": "https://files.pythonhosted.org/packages/e0/f4/fc72e56fa73736c6ac6092ede249385f896ff71815c6aa729624590663d0/pytest-console-scripts-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "7c0bc5a615e61f29b4f4a1cfb4ce4cda", "sha256": "190041df83987552680e36a0ae445e483d3f9674db2cc6dd32a0c30daa6c4091" }, "downloads": -1, "filename": "pytest-console-scripts-0.1.1.tar.gz", "has_sig": false, "md5_digest": "7c0bc5a615e61f29b4f4a1cfb4ce4cda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4936, "upload_time": "2016-10-27T10:34:50", "url": "https://files.pythonhosted.org/packages/93/13/3b13a1ac3d7041b799ecb5c73e460740ed0a5f7a0649d4a01fe8188d9773/pytest-console-scripts-0.1.1.tar.gz" } ], "0.1.10": [ { "comment_text": "", "digests": { "md5": "af9a2a0083514fc634085a1b581a1e8f", "sha256": "6a5f495d1f469bd76698ae969bc01038f2b89584a84d41a373ca7033a0c18753" }, "downloads": -1, "filename": "pytest-console-scripts-0.1.10.tar.gz", "has_sig": false, "md5_digest": "af9a2a0083514fc634085a1b581a1e8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11687, "upload_time": "2019-09-10T13:31:51", "url": "https://files.pythonhosted.org/packages/4c/7b/0aad6eb469a8f5d95fd035b9259469e7ddb2ce1e0da03413790cf8c9236f/pytest-console-scripts-0.1.10.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "e3ac38ed207792d29056bba6944f0c2d", "sha256": "d8e732d7966886698ab7b9d363a5ca7979eac61d5b262756f722870942007591" }, "downloads": -1, "filename": "pytest-console-scripts-0.1.2.tar.gz", "has_sig": false, "md5_digest": "e3ac38ed207792d29056bba6944f0c2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4975, "upload_time": "2016-10-27T13:28:26", "url": "https://files.pythonhosted.org/packages/bb/78/83211fe7a79b388b419756f8ec8083f1ddec0df6e4b41619a4293414a5f2/pytest-console-scripts-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "2ebfe7eeb0fe0dcf84de557c6d64eed1", "sha256": "75188d816f7398956aee48dbff4ce6759d64fbf617f760c8c4cec77608afb8a3" }, "downloads": -1, "filename": "pytest-console-scripts-0.1.3.tar.gz", "has_sig": false, "md5_digest": "2ebfe7eeb0fe0dcf84de557c6d64eed1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5218, "upload_time": "2017-06-08T15:51:44", "url": "https://files.pythonhosted.org/packages/50/3b/6c939121114118fce58e2e50ca334f86ea73d692305dd438d1bf97491d19/pytest-console-scripts-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "15821d1c9a9515e66980b634634f5db6", "sha256": "0a658015805bb4746f86fe829cca0e1958c5a8f4944c695c3c998309e58a5cbc" }, "downloads": -1, "filename": "pytest-console-scripts-0.1.4.tar.gz", "has_sig": false, "md5_digest": "15821d1c9a9515e66980b634634f5db6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5288, "upload_time": "2018-02-03T00:38:32", "url": "https://files.pythonhosted.org/packages/e7/57/7d199c0ba0317e85d46ab04f429a219b2cbfc539a3c283d2064aefe22e89/pytest-console-scripts-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "92939a2cc2e4d5da1e0a8ee4a2110fad", "sha256": "d4e314e7fc481afb57f69432ed147120da32ce4a9673d00aca327a7e628e74d2" }, "downloads": -1, "filename": "pytest-console-scripts-0.1.5.tar.gz", "has_sig": false, "md5_digest": "92939a2cc2e4d5da1e0a8ee4a2110fad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8301, "upload_time": "2018-06-20T13:20:30", "url": "https://files.pythonhosted.org/packages/4b/0d/3d85bc37f98bdaac6b10878f84d7fbb620b8995739216bfe0604c5b15063/pytest-console-scripts-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "4b062323d896d5dd61f2a5a6b66137fb", "sha256": "3b304a22d5baf8f627215e999af39b9b834803012e9cd7e91cbd1ec0799a7828" }, "downloads": -1, "filename": "pytest-console-scripts-0.1.6.tar.gz", "has_sig": false, "md5_digest": "4b062323d896d5dd61f2a5a6b66137fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8361, "upload_time": "2018-09-21T10:29:05", "url": "https://files.pythonhosted.org/packages/7f/35/7e2e9ceae3e552b13a07ee471fcbbf8104b1f26fa6da6f9eae7f59eca823/pytest-console-scripts-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "ff19f10575b1141afd34ff9daf8ce5c4", "sha256": "467bf833c820602884b4914808117fce08b913fc43f1cac5762e3536f00371b7" }, "downloads": -1, "filename": "pytest-console-scripts-0.1.7.tar.gz", "has_sig": false, "md5_digest": "ff19f10575b1141afd34ff9daf8ce5c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9088, "upload_time": "2018-10-01T13:59:21", "url": "https://files.pythonhosted.org/packages/88/ae/597fcf80cf274992c44676086b4a26be21c97e799fbda8eba15a673d25df/pytest-console-scripts-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "d675d1ab5501f91be4c47c850fd10eee", "sha256": "4f81244d46f1738a93946abc2253cf2ce906362ebdf3bf8110b86059af6dd235" }, "downloads": -1, "filename": "pytest-console-scripts-0.1.8.tar.gz", "has_sig": false, "md5_digest": "d675d1ab5501f91be4c47c850fd10eee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9168, "upload_time": "2019-01-11T19:21:54", "url": "https://files.pythonhosted.org/packages/d1/ea/df97e21a968484223142f9d14e35cb0fd9806b39d46900d3f394c4028469/pytest-console-scripts-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "72dfdc1557dea8de1a61167bbc11e339", "sha256": "8508674e176fa33cc04aa1bd0dadd59b10b24d3d23c3d73d75ffc10a7f1bd82e" }, "downloads": -1, "filename": "pytest-console-scripts-0.1.9.tar.gz", "has_sig": false, "md5_digest": "72dfdc1557dea8de1a61167bbc11e339", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9116, "upload_time": "2019-03-05T19:42:42", "url": "https://files.pythonhosted.org/packages/a6/2a/08f1fe318ccca8b2104bf82e9a1b43a7ad98e4df2b8850c5229ea8eec91e/pytest-console-scripts-0.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "af9a2a0083514fc634085a1b581a1e8f", "sha256": "6a5f495d1f469bd76698ae969bc01038f2b89584a84d41a373ca7033a0c18753" }, "downloads": -1, "filename": "pytest-console-scripts-0.1.10.tar.gz", "has_sig": false, "md5_digest": "af9a2a0083514fc634085a1b581a1e8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11687, "upload_time": "2019-09-10T13:31:51", "url": "https://files.pythonhosted.org/packages/4c/7b/0aad6eb469a8f5d95fd035b9259469e7ddb2ce1e0da03413790cf8c9236f/pytest-console-scripts-0.1.10.tar.gz" } ] }