{ "info": { "author": "un.def", "author_email": "me@undef.im", "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.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Testing" ], "description": "# pytest-unittest-filter\n\n[![Build Status](https://img.shields.io/travis/un-def/pytest-unittest-filter.svg?style=flat-square)](https://travis-ci.org/un-def/pytest-unittest-filter) [![PyPI](https://img.shields.io/pypi/v/pytest-unittest-filter.svg?style=flat-square&colorB=brightgreen)](https://pypi.org/project/pytest-unittest-filter/)\n\nA pytest plugin for filtering unittest-based test classes\n\n\n## Description\n\n`pytest` has `unittest`-based tests [support out of the box][pytest-docs-unittest]. It eases incremental transition from legacy test suite to `pytest` for existing projects, but it has one drawback: there is no way to exclude some test cases (`unittest.TestCase` subclasses) from collection. `pytest` has `python_classes` [config option][pytest-docs-python-classes-option], but, as noted in documentation, this option doesn't affect `unittest.TestCase` subclasses:\n\n> Note that unittest.TestCase derived classes are always collected regardless of this option, as unittest\u2018s own collection framework is used to collect those tests.\n\nIt's probably OK for projects that uses builtin `unittest` test runner (`python -m unittest`) because the latter has no any include/exclude option either, but it can be inconvenient if a project test suite is used with `nose` test runner and relies on [hard-coded][nose-src-underscore-exclude] leading underscore filter.\n\nThe plugin provides two new config options: `python_unittest_classes` and `python_unittest_exclude_underscore`.\n\n### `python_unittest_classes`\n\nThis option works like the `python_classes` option mentioned above but for `unittest.TestCase` subclasses:\n\n> One or more name prefixes or glob-style patterns determining which classes are considered for test collection. Search for multiple glob patterns by adding a space between patterns.\n\nA default value is _none_ (no value), i.e. all `unittest.TestCase` subclasses are collected by default.\n\n#### Examples\n\n* to include only classes with names starting with `Test` or `Check`:\n\n ```ini\n [pytest]\n python_unittest_classes = Test* Check*\n ```\n\n or alternatively:\n\n ```ini\n [pytest]\n python_unittest_classes = Test Check\n ```\n\n* to include only classes with names ending with `TestCase`:\n\n ```ini\n [pytest]\n python_unittest_classes = *TestCase\n ```\n\n* to exclude classes with names starting with underscore:\n\n ```ini\n [pytest]\n python_unittest_classes = [!_]*\n ```\n\n### `python_unittest_exclude_underscore`\n\nThis boolean option can be used to mimic [hard-coded][nose-src-underscore-exclude] nose selector behaviour. If the option set to `true`, all classes with names that start with `_` will be excluded. Thus, the last example above can be rewritten as following:\n\n```ini\n[pytest]\npython_unittest_exclude_underscore = true\n```\n\nA default value is `false`.\n\nBoth options can be combined. The following two examples are equivalent:\n\n```ini\n[pytest]\npython_unittest_classes = [!_]*Test [!_]*Check\n```\n\n```ini\n[pytest]\npython_unittest_classes = *Test *Check\npython_unittest_exclude_underscore = true\n```\n\n\n## Changelog\n\n### 0.2.1 (2019-01-12)\n\n* Fixed bug where `python_unittest_exclude_underscore` was applied to any collected item, not only unittest classes\n\n### 0.2.0 (2019-01-11)\n\n* Added `python_unittest_exclude_underscore` option\n\n### 0.1.0 (2018-10-27)\n\n* Initial release\n\n\n## License\n\n[MIT License][license]\n\n\n\n[pytest-docs-unittest]: https://docs.pytest.org/en/latest/unittest.html\n[pytest-docs-python-classes-option]: https://docs.pytest.org/en/latest/reference.html#confval-python_classes\n[nose-src-underscore-exclude]: https://github.com/nose-devs/nose/blob/b3a505071d6de526d470218d310019d04280b69c/nose/selector.py#L62\n[license]: https://github.com/un-def/pytest-unittest-filter/blob/master/LICENSE\n\n\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/un-def/pytest-unittest-filter", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pytest-unittest-filter", "package_url": "https://pypi.org/project/pytest-unittest-filter/", "platform": "", "project_url": "https://pypi.org/project/pytest-unittest-filter/", "project_urls": { "Homepage": "https://github.com/un-def/pytest-unittest-filter" }, "release_url": "https://pypi.org/project/pytest-unittest-filter/0.2.1/", "requires_dist": [ "pytest (>=3.1.0)" ], "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "summary": "A pytest plugin for filtering unittest-based test classes", "version": "0.2.1" }, "last_serial": 4688807, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7e1d43aa65ff8b0b2757b00cbbe1cfec", "sha256": "7d7ecdad313c30cbe92ffcb2b927b276edf9a758c0fb94dfc64d4404aff2a88c" }, "downloads": -1, "filename": "pytest_unittest_filter-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7e1d43aa65ff8b0b2757b00cbbe1cfec", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4151, "upload_time": "2018-10-27T09:54:44", "url": "https://files.pythonhosted.org/packages/cb/f9/f8937ebad109789b9d820203045898573e45a322bb05b9a7995c57bddac6/pytest_unittest_filter-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "31f8564baa5d4bc62d6c368285b0fcc3", "sha256": "f95518dcf2170abfabe5205cc0392d2dc80d88793321c53fcac952682b0dbf3b" }, "downloads": -1, "filename": "pytest-unittest-filter-0.1.0.tar.gz", "has_sig": false, "md5_digest": "31f8564baa5d4bc62d6c368285b0fcc3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 3749, "upload_time": "2018-10-27T09:54:46", "url": "https://files.pythonhosted.org/packages/d1/7d/4d8e029afdb6de7ed7db9d598207b4105bd596395d4140be9212a9841748/pytest-unittest-filter-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "997dd60c4d225e7853890129b83e4ed5", "sha256": "5af0510ac72a64111133917e0c5aacca9f02d77195aec067d94bbe12bb519ee9" }, "downloads": -1, "filename": "pytest_unittest_filter-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "997dd60c4d225e7853890129b83e4ed5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4508, "upload_time": "2019-01-11T17:28:28", "url": "https://files.pythonhosted.org/packages/09/c3/b4eab4dcc0ae32cda0b070a03117c00d7f084e191061715bc63587e93ae6/pytest_unittest_filter-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6bd6915d2386e39534356ae863944539", "sha256": "46ceb961fd4628ac91cb9ef0728f8d5b58e45a3b398f48c8cb471fa3bc304093" }, "downloads": -1, "filename": "pytest-unittest-filter-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6bd6915d2386e39534356ae863944539", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4216, "upload_time": "2019-01-11T17:28:29", "url": "https://files.pythonhosted.org/packages/b1/02/d29bc6ccd5194bb5df272b5889c775b17c740da3a36fe5566cb51d85fdd7/pytest-unittest-filter-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "f201ec903688edcb578985e3d22d2ee9", "sha256": "09f8ac3c93ea7dfcb3215ea0c2cb5a42dbe545bacabf00bf2390580c68ea1714" }, "downloads": -1, "filename": "pytest_unittest_filter-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f201ec903688edcb578985e3d22d2ee9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4554, "upload_time": "2019-01-12T16:37:38", "url": "https://files.pythonhosted.org/packages/e0/e0/f94d49b0c7f75f2f794798e1621684728e16c75501ad028681419c2731ea/pytest_unittest_filter-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5025a30a900828095df552e7709dc690", "sha256": "92dc98bb5e3965e90246d93ce6f23bbc83fa0d8fa3610245b47400f48ac5045b" }, "downloads": -1, "filename": "pytest-unittest-filter-0.2.1.tar.gz", "has_sig": false, "md5_digest": "5025a30a900828095df552e7709dc690", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4283, "upload_time": "2019-01-12T16:37:39", "url": "https://files.pythonhosted.org/packages/fb/35/b047e86881e80273291f287e8d9c9ad41f522dfce3e3ca502a89740f5f6c/pytest-unittest-filter-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f201ec903688edcb578985e3d22d2ee9", "sha256": "09f8ac3c93ea7dfcb3215ea0c2cb5a42dbe545bacabf00bf2390580c68ea1714" }, "downloads": -1, "filename": "pytest_unittest_filter-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f201ec903688edcb578985e3d22d2ee9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4554, "upload_time": "2019-01-12T16:37:38", "url": "https://files.pythonhosted.org/packages/e0/e0/f94d49b0c7f75f2f794798e1621684728e16c75501ad028681419c2731ea/pytest_unittest_filter-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5025a30a900828095df552e7709dc690", "sha256": "92dc98bb5e3965e90246d93ce6f23bbc83fa0d8fa3610245b47400f48ac5045b" }, "downloads": -1, "filename": "pytest-unittest-filter-0.2.1.tar.gz", "has_sig": false, "md5_digest": "5025a30a900828095df552e7709dc690", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4283, "upload_time": "2019-01-12T16:37:39", "url": "https://files.pythonhosted.org/packages/fb/35/b047e86881e80273291f287e8d9c9ad41f522dfce3e3ca502a89740f5f6c/pytest-unittest-filter-0.2.1.tar.gz" } ] }