{ "info": { "author": "NyanKiyoshi", "author_email": "hello@vanille.bid", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Pytest", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "
\n

pytest-django-queries

\n

Generate performance rapports from your django database performance tests\n (inspired by coverage.py).

\n

\n \n Requirement Status\n \n \n Coverage Status\n \n \n Documentation Status\n \n \n Version\n \n \n \"Latest\n \n

\n

\n \n Commits since latest release\n \n \n Supported versions\n \n \n Supported implementations\n \n

\n
\n\n## Usage\nInstall `pytest-django-queries`, write your pytest tests and mark any\ntest that should be counted or use the `count_queries` fixture.\n\nNote: to use the latest development build, use `pip install --pre pytest-django-queries`\n\n```python\nimport pytest\n\n\n@pytest.mark.count_queries\ndef test_query_performances():\n Model.objects.all()\n\n\n# Or...\ndef test_another_query_performances(count_queries):\n Model.objects.all()\n```\n\nEach test file and/or package is considered as a category. Each test inside a \"category\"\ncompose its data, see [Visualising Results](#visualising-results) for more details.\n\nYou will find the [full documentation here](https://pytest-django-queries.readthedocs.io/).\n\n\n\n## Recommendation when Using Fixtures\nYou might end up in the case where you want to add fixtures that are generating queries\nthat you don't want to be counted in the results\u2013or simply, you want to use the\n`pytest-django` plugin alongside of `pytest-django-queries`, which will generate\nunwanted queries in your results.\n\nFor that, you will want to put the `count_queries` fixture as the last fixture to execute.\n\nBut at the same time, you might want to use the the power of pytest markers, to separate\nthe queries counting tests from other tests. In that case, you might want to do something\nlike this to tell the marker to not automatically inject the `count_queries` fixture into\nyour test:\n\n```python\nimport pytest\n\n\n@pytest.mark.count_queries(autouse=False)\ndef test_retrieve_main_menu(fixture_making_queries, count_queries):\n pass\n```\n\nNotice the usage of the keyword argument `autouse=False` and the `count_queries` fixture\nbeing placed last.\n\n## Using pytest-django alongside of pytest-django-queries\nWe recommend you to do the following when using `pytest-django`:\n\n```python\nimport pytest\n\n\n@pytest.mark.django_db\n@pytest.mark.count_queries(autouse=False)\ndef test_retrieve_main_menu(any_fixture, other_fixture, count_queries):\n pass\n```\n\n\n## Integrating with GitHub\n\nTBA.\n\n## Testing Locally\nSimply install `pytest-django-queries` through pip and run your\ntests using `pytest`. A report should have been generated in your\ncurrent working directory in a file called with `.pytest-queries`.\n\nNote: to override the save path, pass the `--django-db-bench PATH` option to pytest.\n\n## Visualising Results\nYou can generate a table from the tests results by using the `show` command:\n```shell\ndjango-queries show\n```\n\nYou will get something like this to represent the results:\n```shell\n+---------+--------------------------------------+\n| Module | Tests |\n+---------+--------------------------------------+\n| module1 | +-----------+---------+------------+ |\n| | | Test Name | Queries | Duplicated | |\n| | +-----------+---------+------------+ |\n| | | test1 | 0 | 0 | |\n| | +-----------+---------+------------+ |\n| | | test2 | 1 | 0 | |\n| | +-----------+---------+------------+ |\n+---------+--------------------------------------+\n| module2 | +-----------+---------+------------+ |\n| | | Test Name | Queries | Duplicated | |\n| | +-----------+---------+------------+ |\n| | | test1 | 123 | 0 | |\n| | +-----------+---------+------------+ |\n+---------+--------------------------------------+\n```\n\n## Exporting the Results (HTML)\nFor a nicer presentation, use the `html` command, to export the results as HTML.\n```shell\ndjango-queries html\n```\n\nIt will generate something [like this](https://pytest-django-queries.readthedocs.io/en/latest/html_export_results.html).\n\n## Comparing Results\n\nYou can run `django-queries backup` (can take a path, optionally) after\nrunning your tests then rerun them. After that, you can run `django-queries diff`\nto generate results looking like this:\n\n\n screenshot\n\n\n## Development\nFirst of all, clone the project locally. Then, install it using the below command.\n\n```shell\n./setup.py develop\n```\n\nAfter that, you need to install the development requirements. For that,\nrun the below command.\n\n```shell\npip install -e .[dev]\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/NyanKiyoshi/pytest-django-queries/", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pytest-django-queries", "package_url": "https://pypi.org/project/pytest-django-queries/", "platform": "", "project_url": "https://pypi.org/project/pytest-django-queries/", "project_urls": { "Homepage": "https://github.com/NyanKiyoshi/pytest-django-queries/" }, "release_url": "https://pypi.org/project/pytest-django-queries/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "Generate performance reports from your django database performance tests.", "version": "1.1.0" }, "last_serial": 5470705, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "0f56aec8aad522d65345857876809628", "sha256": "865619a3becd80b81a065f0f21618d2fa7471855ed0912cc37580afdff02364f" }, "downloads": -1, "filename": "pytest-django-queries-0.0.0.tar.gz", "has_sig": false, "md5_digest": "0f56aec8aad522d65345857876809628", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2350, "upload_time": "2019-05-07T14:54:30", "url": "https://files.pythonhosted.org/packages/1e/64/ad2bec40df586f2a9f8c40dc9a8a691d53a39d66e80c9400854fa21dcefd/pytest-django-queries-0.0.0.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "d33148aacd6dc37d63f8467fc3066f7f", "sha256": "8761cc7af68575a3e333ff52cb929f98727574c3275f8767e71985141d2557f5" }, "downloads": -1, "filename": "pytest-django-queries-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d33148aacd6dc37d63f8467fc3066f7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3584, "upload_time": "2019-05-10T16:39:35", "url": "https://files.pythonhosted.org/packages/56/4f/e976b2400cd0afd574d232e65b4fa565ab46e2452c715ab98923e81eac2f/pytest-django-queries-0.1.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "ba34e7c3c63235f808b385353a443726", "sha256": "34836b51a8b621a278347edb42b92f6d43779500f94d897a95f40723cc9d5d92" }, "downloads": -1, "filename": "pytest-django-queries-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ba34e7c3c63235f808b385353a443726", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13672, "upload_time": "2019-06-07T10:19:39", "url": "https://files.pythonhosted.org/packages/90/5a/0da3f94359a6ab2f948014c9a05b47246751e18c39138da89c20a8df6baa/pytest-django-queries-1.0.0.tar.gz" } ], "1.0.0.dev1": [ { "comment_text": "", "digests": { "md5": "ca91f4140b9a880474aed624b488dfc1", "sha256": "b49aaecef6cd27d1062ac1f4f43f20b1261272034111a2ee1ee27ab8883bf315" }, "downloads": -1, "filename": "pytest-django-queries-1.0.0.dev1.tar.gz", "has_sig": false, "md5_digest": "ca91f4140b9a880474aed624b488dfc1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6572, "upload_time": "2019-05-12T16:40:57", "url": "https://files.pythonhosted.org/packages/af/d7/1530be549e64a03e679f619a9132a2cc4363d8cca2199de35632c614e7f1/pytest-django-queries-1.0.0.dev1.tar.gz" } ], "1.0.0a1": [ { "comment_text": "", "digests": { "md5": "edd4bf23ce180e802d8aa50f33dc2432", "sha256": "b13ef58e49862fec65d3c87399bae29cec54ed64f91ee2c7e29c66e8ccf2c530" }, "downloads": -1, "filename": "pytest-django-queries-1.0.0a1.tar.gz", "has_sig": false, "md5_digest": "edd4bf23ce180e802d8aa50f33dc2432", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6613, "upload_time": "2019-05-13T16:34:53", "url": "https://files.pythonhosted.org/packages/39/f8/2ef2847d6bbdcf5182bb4d9375c18eabc60a7dffe774e20593e35a713a78/pytest-django-queries-1.0.0a1.tar.gz" } ], "1.0.0a2": [ { "comment_text": "", "digests": { "md5": "e922834e99da2851ca1f9716f40672e1", "sha256": "517ba0e0d4580c40a1a48ff72441b7044d34f380b9b677c5ab4e1a9327c2bba7" }, "downloads": -1, "filename": "pytest-django-queries-1.0.0a2.tar.gz", "has_sig": false, "md5_digest": "e922834e99da2851ca1f9716f40672e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8026, "upload_time": "2019-05-17T12:00:57", "url": "https://files.pythonhosted.org/packages/4a/bc/70a8967203a89b7c2f705b17faaebc7d23be554989df7f12ae7888095348/pytest-django-queries-1.0.0a2.tar.gz" } ], "1.0.0a3": [ { "comment_text": "", "digests": { "md5": "b6bfb35740f35ef3dd0f581aa3536dfb", "sha256": "a93cc8b26c1c8081995f5f52cd368e767d0f69241af39827c660abdc9c0f8aee" }, "downloads": -1, "filename": "pytest-django-queries-1.0.0a3.tar.gz", "has_sig": false, "md5_digest": "b6bfb35740f35ef3dd0f581aa3536dfb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8230, "upload_time": "2019-05-17T12:09:53", "url": "https://files.pythonhosted.org/packages/ae/50/d7fc2e86f96050d3d5a8a0700ba20f733c8e000439f836f8d3ef1bc4d5ef/pytest-django-queries-1.0.0a3.tar.gz" } ], "1.0.0b1": [ { "comment_text": "", "digests": { "md5": "e54ff2bab9f8d67fdd07aa3dc3893cbc", "sha256": "1b94e26aa0ce8590d14398e6369a140c2f4c86c9b56749907e8170cd670c9463" }, "downloads": -1, "filename": "pytest-django-queries-1.0.0b1.tar.gz", "has_sig": false, "md5_digest": "e54ff2bab9f8d67fdd07aa3dc3893cbc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11134, "upload_time": "2019-05-24T17:41:53", "url": "https://files.pythonhosted.org/packages/ba/b5/7e77ae0da66a3edf9257158d652b3d68759d12bbbb060e035a63ca57d6a2/pytest-django-queries-1.0.0b1.tar.gz" } ], "1.0.0rc1": [ { "comment_text": "", "digests": { "md5": "fb71fbafc2d2940c4a28bf274995d371", "sha256": "03e76e458062d2e7335c87b719d0eb74f7257abbe54f49fb96a28ef2d3fbc602" }, "downloads": -1, "filename": "pytest-django-queries-1.0.0rc1.tar.gz", "has_sig": false, "md5_digest": "fb71fbafc2d2940c4a28bf274995d371", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12104, "upload_time": "2019-05-27T15:45:21", "url": "https://files.pythonhosted.org/packages/03/f6/ff2026c35567948c0033f3184154bcff976b8f36c62a78ec315d41e27a25/pytest-django-queries-1.0.0rc1.tar.gz" } ], "1.0.0rc2": [ { "comment_text": "", "digests": { "md5": "0c6385693e25fff26cb5d446925926f3", "sha256": "5627f299de128a3e0574ecc2604d1b7d1c57f349e058c1251f878e60a7ffa935" }, "downloads": -1, "filename": "pytest-django-queries-1.0.0rc2.tar.gz", "has_sig": false, "md5_digest": "0c6385693e25fff26cb5d446925926f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13348, "upload_time": "2019-06-05T15:03:30", "url": "https://files.pythonhosted.org/packages/80/6d/6168d993703bc248a478080009796398a93789e9a8eac459d65980b34a7e/pytest-django-queries-1.0.0rc2.tar.gz" } ], "1.0.0rc3": [ { "comment_text": "", "digests": { "md5": "3ed07e95847ed0be48155e979b3744f8", "sha256": "5cc13639401c4c7a49408fbc2fbe32b68a83221f6931018d24710659130b1fb6" }, "downloads": -1, "filename": "pytest-django-queries-1.0.0rc3.tar.gz", "has_sig": false, "md5_digest": "3ed07e95847ed0be48155e979b3744f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13671, "upload_time": "2019-06-06T16:21:28", "url": "https://files.pythonhosted.org/packages/e2/c7/aba29f089f4a41045c7b102352be77d8861f820f05f7e5b0fad64505936f/pytest-django-queries-1.0.0rc3.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "32545176e4167ab8d789a25f8d8536e0", "sha256": "16f4dffa5a4c95bb2e10e6f4289796503578bc46ea69a81b2f4ed8376f7c75b5" }, "downloads": -1, "filename": "pytest-django-queries-1.1.0.tar.gz", "has_sig": false, "md5_digest": "32545176e4167ab8d789a25f8d8536e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13869, "upload_time": "2019-07-01T11:44:08", "url": "https://files.pythonhosted.org/packages/a3/ff/74f9876e51feeaa555b91e6a387843724c8f0c294bc699a746d3cacb8910/pytest-django-queries-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "32545176e4167ab8d789a25f8d8536e0", "sha256": "16f4dffa5a4c95bb2e10e6f4289796503578bc46ea69a81b2f4ed8376f7c75b5" }, "downloads": -1, "filename": "pytest-django-queries-1.1.0.tar.gz", "has_sig": false, "md5_digest": "32545176e4167ab8d789a25f8d8536e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13869, "upload_time": "2019-07-01T11:44:08", "url": "https://files.pythonhosted.org/packages/a3/ff/74f9876e51feeaa555b91e6a387843724c8f0c294bc699a746d3cacb8910/pytest-django-queries-1.1.0.tar.gz" } ] }