{ "info": { "author": "Alexander Belopolsky, Pauli Virtanen", "author_email": "alexander.belopolsky@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Framework :: Pytest", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "License :: OSI Approved :: Python Software Foundation 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.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Testing" ], "description": "# pytest-leaks - A pytest plugin to trace resource leaks\n\n[![See Package Info on PyPI](https://badge.fury.io/py/pytest-leaks.svg)](https://badge.fury.io/py/pytest-leaks)\n[![See Build Status on Travis CI](https://travis-ci.org/abalkin/pytest-leaks.svg?branch=master)](https://travis-ci.org/abalkin/pytest-leaks)\n[![See Build Status on AppVeyor](https://ci.appveyor.com/api/projects/status/github/abalkin/pytest-leaks?branch=master&svg=true)](https://ci.appveyor.com/project/abalkin/pytest-leaks/branch/master)\n\nA pytest plugin to trace resource leaks.\n\n## Usage\n\n leaks:\n -R LEAKS, --leaks=LEAKS\n runs each test several times and examines\n sys.gettotalrefcount() to see if the test appears to\n be leaking references. The argument should be of the\n form stab:run where 'stab' is the number of times the\n test is run to let gettotalrefcount settle down, 'run'\n is the number of times further it is run. These\n parameters all have defaults (5 and 4, respectively),\n and the minimal invocation is '-R :'.\n\nTo add a leaks test to your py.test session, add the `-R` option on the\ncommand line:\n\n $ cd examples; pytest-3 -v -R : test_faucet.py\n =========================== test session starts ===========================\n platform linux -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 --\n cachedir: .pytest_cache\n rootdir: ..\n plugins: leaks-0.3.0\n collected 3 items\n\n test_faucet.py::test_leaky_faucet LEAKED [ 33%]\n test_faucet.py::test_broken_faucet FAILED [ 66%]\n test_faucet.py::test_mended_faucet PASSED [100%]\n\n ================================ FAILURES =================================\n ___________________________ test_broken_faucet ____________________________\n\n def test_broken_faucet():\n > assert 0\n E assert 0\n \n test_faucet.py:6: AssertionError\n ============================== leaks summary ==============================\n examples/test_faucet.py::test_leaky_faucet: leaked references: [2, 2, 2, 2], memory blocks: [2, 2, 2, 2]\n ============== 1 failed, 1 passed, 1 leaked in 0.32 seconds ===============\n\nThe test file used above contains the following code:\n\n $ cat test_faucet.py\n drops = []\n def test_leaky_faucet():\n drops.append({})\n \n def test_broken_faucet():\n assert 0\n \n def test_mended_faucet():\n assert 1\n\nNote that pytest-leaks runs tests several times: if you see test failures\nthat are present only when using pytest-leaks, check that the test does\nnot modify any global state in a way that prevents it from running a\nsecond time.\n\n## Features\n\n- Detects memory leaks by running py.test tests repeatedly and\n comparing total reference counts between the runs.\n\n## Requirements\n\n- py.test version \\>= 3;\n- A debug build of Python (2.7 or \\>=3.5).\n\nOn Linux, Python debug builds can be found in packages `pythonX.Y-dbg`\n(Debian and derivatives) and `python3-debug` (Fedora and derivatives).\n\n## Installation\n\nYou can install \"pytest-leaks\" via [pip](https://pypi.python.org/pypi/pip/) from\n[PyPI](https://pypi.python.org/pypi):\n\n $ pip install pytest-leaks\n\n## Contributing\n\nContributions are very welcome. Tests can be run with\n[tox](https://tox.readthedocs.io/en/latest/), please ensure the coverage\nat least stays the same before you submit a pull request.\n\n## License\n\nDistributed under the terms of the [MIT](http://opensource.org/licenses/MIT) and\n[PSF](https://docs.python.org/3/license.html) licenses, \"pytest-leaks\"\nis free and open source software.\n\n## Issues\n\nIf you encounter any problems, please [file an issue](https://github.com/abalkin/pytest-leaks/issues)\nalong with a detailed description.\n\n## Acknowledgements\n\nThis [Pytest](https://github.com/pytest-dev/pytest) plugin was initially\ngenerated with [Cookiecutter](https://github.com/audreyr/cookiecutter)\nalong with [@hackebrot](https://github.com/hackebrot)'s\n[Cookiecutter-pytest-plugin](https://github.com/pytest-dev/cookiecutter-pytest-plugin)\ntemplate.", "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/abalkin/pytest-leaks", "keywords": "", "license": "MIT and Python-2.0", "maintainer": "Alexander Belopolsky, Pauli Virtanen", "maintainer_email": "alexander.belopolsky@gmail.com", "name": "pytest-leaks", "package_url": "https://pypi.org/project/pytest-leaks/", "platform": "", "project_url": "https://pypi.org/project/pytest-leaks/", "project_urls": { "Homepage": "https://github.com/abalkin/pytest-leaks" }, "release_url": "https://pypi.org/project/pytest-leaks/0.3.0/", "requires_dist": null, "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "summary": "A pytest plugin to trace resource leaks.", "version": "0.3.0" }, "last_serial": 5577529, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a28612def76ef59711ef584b86887448", "sha256": "70f7737727b8243cf3c2350d30ae76085043b1e6b004c92e6900f9e2c47c182c" }, "downloads": -1, "filename": "pytest_leaks-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a28612def76ef59711ef584b86887448", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5539, "upload_time": "2016-11-10T21:46:01", "url": "https://files.pythonhosted.org/packages/aa/eb/a94324c7334432c529dd45f7b8e37f65124a22c3c59c94a65e3d3581458f/pytest_leaks-0.1.0-py3-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "4aed28499f61859d09dcf961417f7b4b", "sha256": "c98362987a91cb3fbc9fc693b685a65c766bf6cbef568330ba0e48cff6b4cf26" }, "downloads": -1, "filename": "pytest_leaks-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4aed28499f61859d09dcf961417f7b4b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7067, "upload_time": "2016-11-17T02:13:05", "url": "https://files.pythonhosted.org/packages/55/16/c4dc7d22b34cec66f1253c92546223f63cd998ef76d55b4d30df7b5a31ed/pytest_leaks-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f89829e74cb2b7363ea9349746d6d0d3", "sha256": "5daffa270aac820f66fa113b18785e7bfc8cd70e6f0ad6d1251aa77c44db2976" }, "downloads": -1, "filename": "pytest-leaks-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f89829e74cb2b7363ea9349746d6d0d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5886, "upload_time": "2016-11-17T02:13:07", "url": "https://files.pythonhosted.org/packages/db/ba/085a1a8644683a7d4a8663ac217cf73be8484d9a6800837ceb6dea8355a2/pytest-leaks-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "f4187adb6ea07aae6af6942ea0a35aba", "sha256": "fe5891681c725fb07125931931af7541cc45d569f2ed2e483c336c01a283f3bf" }, "downloads": -1, "filename": "pytest_leaks-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f4187adb6ea07aae6af6942ea0a35aba", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8262, "upload_time": "2016-11-22T20:37:57", "url": "https://files.pythonhosted.org/packages/7d/b0/b3c261c82aaeb4b5c3dfa520f8c5aad98b7bfb710358b7aed77e0cd9dba4/pytest_leaks-0.2.1-py3-none-any.whl" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "62b2bfdd70d1cf6df453f755481c80dd", "sha256": "b18538dd5a31a886f2265c760e2fb6fcf8ee5ffab4358c555541bc6b79ed4c74" }, "downloads": -1, "filename": "pytest_leaks-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "62b2bfdd70d1cf6df453f755481c80dd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8093, "upload_time": "2016-11-22T21:55:56", "url": "https://files.pythonhosted.org/packages/a0/a4/aee9163f07f8183131259b7f652a1fe55ae54f9a817353dd261c19c726c3/pytest_leaks-0.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8df8592ecd8a19da80e19de2fc5faa67", "sha256": "c38a82f7740443d65098cf9df3dd0412494981ca7746a833ee193cdfb4e53326" }, "downloads": -1, "filename": "pytest-leaks-0.2.2.tar.gz", "has_sig": false, "md5_digest": "8df8592ecd8a19da80e19de2fc5faa67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6523, "upload_time": "2016-11-22T21:56:46", "url": "https://files.pythonhosted.org/packages/ee/37/47ee85fe04c3fb0da64fab785752e98cb7568ff6197d474b315294ec3ea6/pytest-leaks-0.2.2.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "d6c91d6e80e63e1a4e940a7d725355ba", "sha256": "1834360b92ba7f5ac6a7fc993e444832de93c1f592664ddc539752288332011f" }, "downloads": -1, "filename": "pytest-leaks-0.3.0.tar.gz", "has_sig": false, "md5_digest": "d6c91d6e80e63e1a4e940a7d725355ba", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 17177, "upload_time": "2019-07-24T13:10:53", "url": "https://files.pythonhosted.org/packages/c6/bf/b1db4556c2c1a39fef3a59335fbb0d26fabb21ec4b0af86fa12498c96f08/pytest-leaks-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d6c91d6e80e63e1a4e940a7d725355ba", "sha256": "1834360b92ba7f5ac6a7fc993e444832de93c1f592664ddc539752288332011f" }, "downloads": -1, "filename": "pytest-leaks-0.3.0.tar.gz", "has_sig": false, "md5_digest": "d6c91d6e80e63e1a4e940a7d725355ba", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 17177, "upload_time": "2019-07-24T13:10:53", "url": "https://files.pythonhosted.org/packages/c6/bf/b1db4556c2c1a39fef3a59335fbb0d26fabb21ec4b0af86fa12498c96f08/pytest-leaks-0.3.0.tar.gz" } ] }