{ "info": { "author": "Jakub Klinkovsk\u00fd and Micha\u0142 Pasternak", "author_email": "michal.dtz+pytestnginx@gmail.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\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mpasternak/pytest-nginx", "keywords": "tests py.test pytest fixture nginx", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "pytest-nginx-iplweb", "package_url": "https://pypi.org/project/pytest-nginx-iplweb/", "platform": "", "project_url": "https://pypi.org/project/pytest-nginx-iplweb/", "project_urls": { "Homepage": "https://github.com/mpasternak/pytest-nginx" }, "release_url": "https://pypi.org/project/pytest-nginx-iplweb/1.1.1/", "requires_dist": null, "requires_python": "", "summary": "nginx fixture for pytest - iplweb temporary fork", "version": "1.1.1" }, "last_serial": 4884005, "releases": { "1.1.1": [ { "comment_text": "", "digests": { "md5": "a6964db7b6476cbdc5575ab3336af811", "sha256": "4e3c6004d412264464ab1bf1e8b1253d050c93bafd87c2f458cbc56680de143e" }, "downloads": -1, "filename": "pytest_nginx_iplweb-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a6964db7b6476cbdc5575ab3336af811", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 19810, "upload_time": "2019-03-01T12:33:22", "url": "https://files.pythonhosted.org/packages/89/f2/089d513f50f70b4061790aa396cf1b07dcf9702bf465bbe9cb8aa35dd02c/pytest_nginx_iplweb-1.1.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a6964db7b6476cbdc5575ab3336af811", "sha256": "4e3c6004d412264464ab1bf1e8b1253d050c93bafd87c2f458cbc56680de143e" }, "downloads": -1, "filename": "pytest_nginx_iplweb-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a6964db7b6476cbdc5575ab3336af811", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 19810, "upload_time": "2019-03-01T12:33:22", "url": "https://files.pythonhosted.org/packages/89/f2/089d513f50f70b4061790aa396cf1b07dcf9702bf465bbe9cb8aa35dd02c/pytest_nginx_iplweb-1.1.1-py3-none-any.whl" } ] }