{ "info": { "author": "Michael Foord", "author_email": "michael@voidspace.org.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.4", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Testing" ], "description": "This is the test discovery mechanism and ``load_tests`` protocol for unittest\nbackported from Python 2.7 to work with Python 2.4 or more recent (including \nPython 3).\n\n.. note::\n\n Test discovery is just part of what is new in unittest in Python 2.7. All\n of the new features have been backported to run on Python 2.4-2.6, including\n test discovery. This is the \n `unittest2 package `_.\n\ndiscover can be installed with pip or easy_install. After installing switch the\ncurrent directory to the top level directory of your project and run::\n\n python -m discover\n python discover.py\n \n(If you have setuptools or `distribute `_\ninstalled you will also have a ``discover`` script available.)\n\nThis will discover all tests (with certain restrictions) from the current\ndirectory. The discover module has several options to control its behavior (full\nusage options are displayed with ``python -m discover -h``)::\n\n Usage: discover.py [options]\n\n Options:\n -v, --verbose Verbose output\n -s directory Directory to start discovery ('.' default)\n -p pattern Pattern to match test files ('test*.py' default)\n -t directory Top level directory of project (default to\n start directory)\n\n For test discovery all test modules must be importable from the top\n level directory of the project.\n\nFor example to use a different pattern for matching test modules run::\n\n python -m discover -p '*test.py'\n\n(For UNIX-like shells like Bash you need to put quotes around the test pattern\nor the shell will attempt to expand the pattern instead of passing it through to\ndiscover. On Windows you must *not* put quotes around the pattern as the\nWindows shell will pass the quotes to discover as well.)\n\nTest discovery is implemented in ``discover.DiscoveringTestLoader.discover``. As\nwell as using discover as a command line script you can import\n``DiscoveringTestLoader``, which is a subclass of ``unittest.TestLoader``, and\nuse it in your test framework.\n\nThis method finds and returns all test modules from the specified start\ndirectory, recursing into subdirectories to find them. Only test files that\nmatch *pattern* will be loaded. (Using shell style pattern matching.)\n\nAll test modules must be importable from the top level of the project. If\nthe start directory is not the top level directory then the top level\ndirectory must be specified separately.\n\nThe ``load_tests`` protocol allows test modules and packages to customize how\nthey are loaded. This is implemented in\n``discover.DiscoveringTestLoader.loadTestsFromModule``. If a test module defines\na ``load_tests`` function then tests are loaded from the module by calling\n``load_tests`` with three arguments: `loader`, `standard_tests`, `None`.\n\nIf a test package name (directory with `__init__.py`) matches the\npattern then the package will be checked for a ``load_tests``\nfunction. If this exists then it will be called with *loader*, *tests*,\n*pattern*.\n\n.. note::\n\n The default pattern for matching tests is ``test*.py``. The '.py' means\n that it will match test files and *not* match package names. You can\n change this by changing the pattern using a command line option like\n ``-p 'test*'``.\n\nIf ``load_tests`` exists then discovery does *not* recurse into the package,\n``load_tests`` is responsible for loading all tests in the package.\n\nThe pattern is deliberately not stored as a loader attribute so that\npackages can continue discovery themselves. *top_level_dir* is stored so\n``load_tests`` does not need to pass this argument in to\n``loader.discover()``.\n\ndiscover.py is maintained in a google code project (where bugs and feature\nrequests should be posted): http://code.google.com/p/unittest-ext/\n\nThe latest development version of discover.py can be found at:\nhttp://code.google.com/p/unittest-ext/source/browse/trunk/discover.py\n\n\nCHANGELOG\n=========\n\n\n2010/06/11 0.4.0\n----------------\n\n* Addition of a setuptools compatible test collector. Set\n \"test_suite = 'discover.collector'\" in setup.py. \"setup.py test\" will start\n test discovery with default parameters from the same directory as the setup.py.\n* Allow test discovery using dotted module names instead of a path.\n* Addition of a setuptools compatible entrypoint for the discover script.\n* A faulty load_tests function will not halt test discovery. A failing test\n is created to report the error.\n* If test discovery imports a module from the wrong location (usually because\n the module is globally installed and the user is expecting to run tests\n against a development version in a different location) then discovery halts\n with an ImportError and the problem is reported.\n* Matching files during test discovery is done in\n ``DiscoveringTestLoader._match_path``. This method can be overriden in\n subclasses to, for example, match on the full file path or use regular\n expressions for matching.\n* Tests for discovery ported from unittest2. (The tests require unittest2 to\n run.)\n\nFeature parity with the ``TestLoader`` in Python 2.7 RC 1.\n\n\n2010/02/07 0.3.2\n----------------\n\n* If ``load_tests`` exists it is passed the standard tests as a ``TestSuite`` \n rather than a list of tests.\n\n2009/09/13 0.3.1\n----------------\n\n* Fixed a problem when a package directory matches the discovery pattern.\n\n2009/08/20 0.3.0\n----------------\n\n* Failing to import a file (e.g. due to a syntax error) no longer halts\n discovery but is reported as a failure.\n* Discovery will not attempt to import test files whose names are not valid Python\n identifiers, even if they match the pattern.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/discover/", "keywords": "unittest,testing,tests", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "discover", "package_url": "https://pypi.org/project/discover/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/discover/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/discover/" }, "release_url": "https://pypi.org/project/discover/0.4.0/", "requires_dist": null, "requires_python": null, "summary": "Test discovery for unittest. Backported from Python 2.7 for Python 2.4+", "version": "0.4.0" }, "last_serial": 788985, "releases": { "0.0": [], "0.1.0": [ { "comment_text": "", "digests": { "md5": "ee44974b16345b445d75e22fbf88462e", "sha256": "97137447236d1c941bcbb2462fbe1078f35f890a9a6c5cad3e7d3be4e5c8ca83" }, "downloads": -1, "filename": "discover-0.1.0.tar.gz", "has_sig": false, "md5_digest": "ee44974b16345b445d75e22fbf88462e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3340, "upload_time": "2009-06-16T00:59:12", "url": "https://files.pythonhosted.org/packages/ee/fb/9864280455e5ceabe81833ea7e9c65f2e39c3cd2161ee6281aba1ff1be96/discover-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "d6407603fc19130c79287169015a71ff", "sha256": "8502b0e70d8587b6178a0044f556bca68af4aaf320554821bb8b69a010dd801c" }, "downloads": -1, "filename": "discover-0.2.0.tar.gz", "has_sig": false, "md5_digest": "d6407603fc19130c79287169015a71ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3475, "upload_time": "2009-06-17T01:30:01", "url": "https://files.pythonhosted.org/packages/b9/62/f73f25b522be9765915c9d41807cf5a9366ae8fc6b5ac2bdea450bb9dc93/discover-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "ffe78ef9dac7228dd7f366dddedcd674", "sha256": "41f081982b6e5c3b584e5f3c46c1469d66bf22dc459795640aacbe81b886a3d0" }, "downloads": -1, "filename": "discover-0.2.1.tar.gz", "has_sig": false, "md5_digest": "ffe78ef9dac7228dd7f366dddedcd674", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4423, "upload_time": "2009-06-17T15:36:22", "url": "https://files.pythonhosted.org/packages/8e/23/b3ad6464ec5dbcd620d60e87685b3afab7e85c9ea8ac772e459bd3bf3df0/discover-0.2.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "51d95a8b071f526203a91865ff7ca297", "sha256": "677b1e34d51bad5784cd3aad3d97ed42770f7842b9c2196020b567f10fa12117" }, "downloads": -1, "filename": "discover-0.2.1.zip", "has_sig": false, "md5_digest": "51d95a8b071f526203a91865ff7ca297", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5373, "upload_time": "2009-06-17T13:35:20", "url": "https://files.pythonhosted.org/packages/8f/6c/2405bc9721f9a74d744f2c2d0d683baf537aeb6c83e720f722d71e094c8c/discover-0.2.1.zip" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "76220083c81806b47c38a2df5f3cc6ac", "sha256": "eccdb1b7574c34ac9eab58b9603e9bcf6ef923996e2c1f8e321ed42b68680fdd" }, "downloads": -1, "filename": "discover-0.3.0.tar.gz", "has_sig": false, "md5_digest": "76220083c81806b47c38a2df5f3cc6ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3973, "upload_time": "2009-08-20T22:00:12", "url": "https://files.pythonhosted.org/packages/9b/97/459d47cb1c4a712b8da8cc9ef8ca3b886b9bd010f57e239d4e1b0f7d651b/discover-0.3.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "5ebd5fcfea6ade7c894c1e69ef2ea3f1", "sha256": "f356e9b4754d5b02bafe12c3a912dd2ad0c55f93ded43614cc0eaf23f3bc7d7e" }, "downloads": -1, "filename": "discover-0.3.0.zip", "has_sig": false, "md5_digest": "5ebd5fcfea6ade7c894c1e69ef2ea3f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5959, "upload_time": "2009-08-20T15:53:18", "url": "https://files.pythonhosted.org/packages/87/d2/8c32327ca3fbc5a493b382bd87daf1be1b2979a27548a9a8dc82c715fbc2/discover-0.3.0.zip" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "79f795c1abe0f19834df7869b19c9b63", "sha256": "2a4d3658a6e085419f5ebd55a9825e0de0536093dfa8bb49c2af0e4d4ca57551" }, "downloads": -1, "filename": "discover-0.3.1.tar.gz", "has_sig": false, "md5_digest": "79f795c1abe0f19834df7869b19c9b63", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3968, "upload_time": "2009-09-14T00:42:40", "url": "https://files.pythonhosted.org/packages/19/85/15c1d148630d3fa5d59e853fb3109fc142286e7d8e60f91ac2eb572e3e2f/discover-0.3.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "8df29a668943630d1f1c0dfde50eef49", "sha256": "2e83658c29aef08aeb17757d889805943c603aa99785e2cd8a1d5e9dc53efd4a" }, "downloads": -1, "filename": "discover-0.3.1.zip", "has_sig": false, "md5_digest": "8df29a668943630d1f1c0dfde50eef49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4388, "upload_time": "2009-09-14T00:44:28", "url": "https://files.pythonhosted.org/packages/99/6b/f26f92929d1a6fdb907755ed18b49851641607363bc9e0c8d5a07b444d2a/discover-0.3.1.zip" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "bbc7079a2fc5f5277ed580245f419f36", "sha256": "27ac76925c35c3ecb241791bcd00b70763748b579b09eab321506bbf8cee2b4c" }, "downloads": -1, "filename": "discover-0.3.2.tar.gz", "has_sig": false, "md5_digest": "bbc7079a2fc5f5277ed580245f419f36", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5704, "upload_time": "2010-02-07T22:03:49", "url": "https://files.pythonhosted.org/packages/d9/5e/42a4bafb4e05ba7cecc6042175d4c8d5087c997eb4441365fa311a710ca8/discover-0.3.2.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "30bb643af4f5ea47fff572b5c346207d", "sha256": "05c3fa9199e57d4b16fb653e02d65713adc1f89ef55324fb0c252b1cf9070d79" }, "downloads": -1, "filename": "discover-0.4.0.tar.gz", "has_sig": false, "md5_digest": "30bb643af4f5ea47fff572b5c346207d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8608, "upload_time": "2010-06-11T16:11:26", "url": "https://files.pythonhosted.org/packages/2d/89/28d437f7c96f4062860fed466d81e3d247c6a17aea687a0ecdb1aa30f2c3/discover-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "30bb643af4f5ea47fff572b5c346207d", "sha256": "05c3fa9199e57d4b16fb653e02d65713adc1f89ef55324fb0c252b1cf9070d79" }, "downloads": -1, "filename": "discover-0.4.0.tar.gz", "has_sig": false, "md5_digest": "30bb643af4f5ea47fff572b5c346207d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8608, "upload_time": "2010-06-11T16:11:26", "url": "https://files.pythonhosted.org/packages/2d/89/28d437f7c96f4062860fed466d81e3d247c6a17aea687a0ecdb1aa30f2c3/discover-0.4.0.tar.gz" } ] }