{ "info": { "author": "Zhongming Qu", "author_email": "qzmfranklin@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "======\npitest\n======\n\n.. image:: https://travis-ci.org/qzmfranklin/pitest.svg?branch=master\n :target: https://travis-ci.org/qzmfranklin/pitest\n :alt: Build status\n\nAn object oriented testing framework.\n\n\nInstallation\n============\n\nFrom pip3::\n\n $ pip3 install --upgrade rstcheck\n\nFrom source::\n\n $ python3 setup.py --quiet install\n\nTests\n=====\n\nInstall the pitest package first, then::\n\n $ cd unittests\n $ python3 -m unittest\n\nUsage Examples\n=======================\n\n1. Write a test case:\n\n.. code-block:: python\n\n import pitest\n\n class MyTestCase(pitest.TestCaseBase):\n # By default, test methods are methods whose names start with 'test_'. You\n # can change the matching patterns by defining the 'test_patterns' class\n # variable by uncommenting the following line:\n # test_patterns = [ 'mytest_*', 'yourtest_*' ]\n\n # The start * means it matches anything, just like the command line glob.\n\n # If test methods have inter-dependencies, i.e., certain tests must precede\n # some other tests, you can define the dependencies using the\n # 'internal_deps' class variable. Here is an example:\n # internal_deps = { 'test_foo1': [ 'test_bar1*', 'test_bar2*' ],\n # 'test_hel*lo': [ 'test_no', 'test_yes*' ],\n # }\n\n # If this test case depend on other test cases, you can specify their\n # dependencies via the 'deps' class variable. Here is an example:\n # deps = [ 'MyTestCase1', 'MyTestCaseFoo*', ]\n\n # When you reference other test cases, you do NOT need to import the files\n # that define the referenced test cases. But if they cannot be found by the\n # end of the day, error will occur.\n\n def __init__(self[, *args[, **kwargs]]):\n pass\n\n # Run once before running all test methods.\n def setup_instance(self[, *args[, **kwargs]]):\n pass\n\n # Run once after running all test methods.\n def teardown_instance(self[, *args[, **kwargs]]):\n pass\n\n # Run once before running every single test method.\n def setup(self[, *args[, **kwargs]]):\n pass\n\n # Run once after running every single test method.\n def teardown(self[, *args[, **kwargs]]):\n pass\n\n # Actual test methods, names matching 'test_patterns'.\n def test_foo_something(self[, *args[, **kwargs]]):\n pass\n def test_foo_something_else(self[, *args[, **kwargs]]):\n pass\n def test_bar_something(self[, *args[, **kwargs]]):\n pass\n def test_bar_something_else(self[, *args[, **kwargs]]):\n pass\n\n2. Write argument file\n\n.. code-block:: python\n\n import pitest\n\n __pitest_main_default_args_name__ = 'my_args'\n\n my_args = pitest.TestCaseArgs()\n my_args.set_method_args('__init__',\n args = ('Anndee', ),\n kwargs = { 'kwarg0': 'KoolArg' })\n my_args.set_method_args('test',\n args = ('naathing', ),\n kwargs = { 'kwarg1': 'at owl' })\n\n my_args2 = pitest.TestCaseArgs()\n my_args2.set_method_args('__init__',\n args = ('Bashii', ),\n kwargs = { 'kwarg0': 'KoolArg2' })\n my_args2.set_method_args('test',\n args = ('naathing', ),\n kwargs = { 'kwarg1': 'at owlll' })\n\n3. Run the test cases\n\nDiscover tests::\n\n $ python3 -m pitest discover (case | method | all)\n\nRun tests::\n\n $ python3 -m pitest run (case | method) name\n\nScan given directory::\n\n $ python3 -m pitest --start-dir some/dir ...\n\nRun tests with dynamic arguments::\n\n $ python3 -m pitest run case MyTestCase --args-file my_args.py\n\nUse a non-default argument object in the file::\n\n $ python3 -m pitest run case MyTestCase --args-file my_args.py \\\n --args-name my_args2", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/qzmfranklin/pitest", "keywords": "test,unittest", "license": "GPL3,LGPL", "maintainer": null, "maintainer_email": null, "name": "pitest", "package_url": "https://pypi.org/project/pitest/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pitest/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/qzmfranklin/pitest" }, "release_url": "https://pypi.org/project/pitest/0.1/", "requires_dist": null, "requires_python": null, "summary": "An Object Oriented Testing Framework.", "version": "0.1" }, "last_serial": 2033194, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "f4aa40f141c4d2e5d22cc92278c2775c", "sha256": "bcb6877a19ea6d834851476cf5a005cf4517a65896eb31a3bc5f44e47ab99cb5" }, "downloads": -1, "filename": "pitest-0.1.tar.gz", "has_sig": false, "md5_digest": "f4aa40f141c4d2e5d22cc92278c2775c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13694, "upload_time": "2016-03-29T00:46:59", "url": "https://files.pythonhosted.org/packages/2c/c6/5afbe7e3dd3b62371d42423d104a5ae66548470a124fe12c44cff907d6bd/pitest-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f4aa40f141c4d2e5d22cc92278c2775c", "sha256": "bcb6877a19ea6d834851476cf5a005cf4517a65896eb31a3bc5f44e47ab99cb5" }, "downloads": -1, "filename": "pitest-0.1.tar.gz", "has_sig": false, "md5_digest": "f4aa40f141c4d2e5d22cc92278c2775c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13694, "upload_time": "2016-03-29T00:46:59", "url": "https://files.pythonhosted.org/packages/2c/c6/5afbe7e3dd3b62371d42423d104a5ae66548470a124fe12c44cff907d6bd/pitest-0.1.tar.gz" } ] }