{ "info": { "author": "Jakub Klinkovsk\u00fd", "author_email": "lahwaacz@users.noreply.github.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "pytest-nginx\n============\n\npytest-nginx is a pytest plugin, that allows you to test code, which requires\ncommunicating with a full-fledged web server. Custom fixtures can be made which\nmanage the content of the server root directory.\n\nUsage\n=====\n\nThe plugin contains one fixture:\n\n* **nginx_proc** - session scoped fixture, which manages the nginx daemon with\n the most basic configuration for serving static files.\n* **nginx_php_proc** - session scoped fixture, which manages the nginx daemon\n and the php-fpm daemon, both configured to work together.\n\nAll fixtures take the name of a fixture managing the server root directory. In\nthe simplest case it is an empty temporary directory managed with the\n``tmpdir_factory`` built-in fixture:\n\n.. code-block:: python\n\n from pytest_nginx import factories\n \n @pytest.fixture(scope=\"session\")\n def nginx_server_root(tmpdir_factory):\n return tmpdir_factory.mktemp(\"nginx-server-root\")\n \n nginx_proc = factories.nginx_proc(\"nginx_server_root\")\n\nTo manage the served content, you can create additional module or\nfunction-scoped fixtures on top of ``nginx_proc``:\n\n.. code-block:: python\n\n @pytest.fixture(scope=\"module\")\n def nginx_hello_world(nginx_proc):\n f = open(os.path.join(nginx_proc.server_root, \"index.html\"), \"w\")\n f.write(\"Hello world! This is pytest-nginx serving on host {}, port {}.\"\n .format(nginx_proc.host, nginx_proc.port))\n f.close()\n return nginx_proc\n\nConfiguration\n=============\n\nYou can define your settings in three ways: with fixture factory arguments,\nwith command line options and with ``pytest.ini`` configuration options. These\nsettings are handled in the following order:\n\n1. Fixture factory arguments\n2. Command line options\n3. ``pytest.ini`` configuration options\n\n+---------------------------+---------------------------+---------------------------+---------------------------+\n| Fixture factory argument | Command line option | pytest.ini option | Default |\n+===========================+===========================+===========================+===========================+\n| host | --nginx-host | nginx_host | 127.0.0.1 |\n+---------------------------+---------------------------+---------------------------+---------------------------+\n| port | --nginx-port | nginx_port | random |\n+---------------------------+---------------------------+---------------------------+---------------------------+\n| nginx_exec | --nginx-exec | nginx_exec | nginx |\n+---------------------------+---------------------------+---------------------------+---------------------------+\n| nginx_params | --nginx-params | nginx_params | \"\" |\n+---------------------------+---------------------------+---------------------------+---------------------------+\n| nginx_config_template | --nginx-config-template | nginx_config_template | auto-generated |\n+---------------------------+---------------------------+---------------------------+---------------------------+\n| php_fpm_exec | --php-fpm-exec | php_fpm_exec | php-fpm |\n+---------------------------+---------------------------+---------------------------+---------------------------+\n| php_fpm_params | --php-fpm-params | php_fpm_params | \"\" |\n+---------------------------+---------------------------+---------------------------+---------------------------+\n| php_fpm_config_template | --php-fpm-config-template | php_fpm_config_template | auto-generated |\n+---------------------------+---------------------------+---------------------------+---------------------------+\n\nExamples showing how to specify the port number:\n\n* Pass it as an argument to the factory function:\n\n .. code-block:: python\n\n nginx_proc = factories.nginx_proc(port=8888)\n\n* Use the ``--nginx-port`` command line option when running pytest:\n\n .. code-block::\n\n pytest ./tests --nginx-port=8888\n\n\n* Add the ``nginx_port`` option to the ``pytest.ini`` file:\n\n .. code-block:: ini\n\n [pytest]\n nginx_port = 8888", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lahwaacz/pytest-nginx", "keywords": "tests py.test pytest fixture nginx", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "pytest-nginx", "package_url": "https://pypi.org/project/pytest-nginx/", "platform": "", "project_url": "https://pypi.org/project/pytest-nginx/", "project_urls": { "Homepage": "https://github.com/lahwaacz/pytest-nginx" }, "release_url": "https://pypi.org/project/pytest-nginx/1.1/", "requires_dist": null, "requires_python": "", "summary": "nginx fixture for pytest", "version": "1.1" }, "last_serial": 3092759, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "d10abd741bbbabf7d524e47e10bc9dbb", "sha256": "75b98d47f5f2016143b9139b73ef634533a1f2c8e3182d8437629d859c15364e" }, "downloads": -1, "filename": "pytest_nginx-1.0-py3.6.egg", "has_sig": true, "md5_digest": "d10abd741bbbabf7d524e47e10bc9dbb", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 12747, "upload_time": "2017-08-12T15:31:23", "url": "https://files.pythonhosted.org/packages/b6/6c/58cf3cc2aeccee02d5694adc1405023a3c66d0cf234367475b2244ce9c8b/pytest_nginx-1.0-py3.6.egg" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "2b3d352113cec40e164d1f828bc57575", "sha256": "b459519dd57c1ba5c21193898de79a4d2eabd9ddc19405ab298fa9eaa1bd2081" }, "downloads": -1, "filename": "pytest_nginx-1.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "2b3d352113cec40e164d1f828bc57575", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10396, "upload_time": "2017-08-12T20:19:12", "url": "https://files.pythonhosted.org/packages/14/ec/3bdc3d47e3faed35adb238ff83d9fd8ebf58f297b87577c84943d16c34a2/pytest_nginx-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5004273948680c43275e5385f7a5ce57", "sha256": "9dec47a0171d282b0d4e07043d68810d32b0f43f82bde91a8ad06016fb98747e" }, "downloads": -1, "filename": "pytest_nginx-1.1-py3.6.egg", "has_sig": true, "md5_digest": "5004273948680c43275e5385f7a5ce57", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 15254, "upload_time": "2017-08-12T19:58:33", "url": "https://files.pythonhosted.org/packages/bb/e2/c0710f120f860f60850f39c29e1a1367b4d1e359a905eb2d50535aefb66d/pytest_nginx-1.1-py3.6.egg" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2b3d352113cec40e164d1f828bc57575", "sha256": "b459519dd57c1ba5c21193898de79a4d2eabd9ddc19405ab298fa9eaa1bd2081" }, "downloads": -1, "filename": "pytest_nginx-1.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "2b3d352113cec40e164d1f828bc57575", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10396, "upload_time": "2017-08-12T20:19:12", "url": "https://files.pythonhosted.org/packages/14/ec/3bdc3d47e3faed35adb238ff83d9fd8ebf58f297b87577c84943d16c34a2/pytest_nginx-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5004273948680c43275e5385f7a5ce57", "sha256": "9dec47a0171d282b0d4e07043d68810d32b0f43f82bde91a8ad06016fb98747e" }, "downloads": -1, "filename": "pytest_nginx-1.1-py3.6.egg", "has_sig": true, "md5_digest": "5004273948680c43275e5385f7a5ce57", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 15254, "upload_time": "2017-08-12T19:58:33", "url": "https://files.pythonhosted.org/packages/bb/e2/c0710f120f860f60850f39c29e1a1367b4d1e359a905eb2d50535aefb66d/pytest_nginx-1.1-py3.6.egg" } ] }