{ "info": { "author": "Ordanis Sanchez Suero, Leo Lee", "author_email": "mail@debugtalk.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# PyUnitReport\n\nPyUnitReport is a unittest test runner that save test results in Html files, for human readable presentation of results.\n\n## Installation\n\n```bash\n$ pip install PyUnitReport\n```\n\n## Usage\n\n### testcase\n\n```python\nfrom pyunitreport import HTMLTestRunner\nimport unittest\n\nclass TestStringMethods(unittest.TestCase):\n \"\"\" Example test for HtmlRunner. \"\"\"\n\n def test_upper(self):\n self.assertEqual('foo'.upper(), 'FOO')\n\n def test_isupper(self):\n self.assertTrue('FOO'.isupper())\n self.assertFalse('Foo'.isupper())\n\n def test_split(self):\n s = 'hello world'\n self.assertEqual(s.split(), ['hello', 'world'])\n # check that s.split fails when the separator is not a string\n with self.assertRaises(TypeError):\n s.split(2)\n\n def test_error(self):\n \"\"\" This test should be marked as error one. \"\"\"\n raise ValueError\n\n def test_fail(self):\n \"\"\" This test should fail. \"\"\"\n self.assertEqual(1, 2)\n\n @unittest.skip(\"This is a skipped test.\")\n def test_skip(self):\n \"\"\" This test should be skipped. \"\"\"\n pass\n\nif __name__ == '__main__':\n unittest.main(testRunner=HTMLTestRunner(output='example_dir'))\n```\n\nIn most cases, you can use `PyUnitReport` with `unittest.main`, just pass it with the `testRunner` keyword.\n\nFor `HTMLTestRunner`, the only parameter you must pass in is `output`, which specifies the directory of your generated report. Also, if you want to specify the report name, you can use the `report_name` parameter, otherwise the report name will be the datetime you run test. And if you want to run testcases in `failfast` mode, you can pass in a `failfast` parameter and assign it to be True.\n\nHere is another way to run the testcases.\n\n```python\nfrom pyunitreport import HTMLTestRunner\n\nkwargs = {\n \"output\": output_folder_name,\n \"report_name\": report_name,\n \"failfast\": True\n}\nresult = HTMLTestRunner(**kwargs).run(task_suite)\n```\n\n### testsuite\n\nFor those who have `test suites` it works too, just create a runner instance and call the run method with your suite.\n\nHere is an example:\n\n```python\nfrom unittest import TestLoader, TestSuite\nfrom pyunitreport import HTMLTestRunner\nimport ExampleTest\nimport Example2Test\n\nexample_tests = TestLoader().loadTestsFromTestCase(ExampleTests)\nexample2_tests = TestLoader().loadTestsFromTestCase(Example2Test)\n\nsuite = TestSuite([example_tests, example2_tests])\nkwargs = {\n \"output\": output_folder_name,\n \"report_name\": report_name,\n \"failfast\": True\n}\nrunner = HTMLTestRunner(**kwargs)\nrunner.run(suite)\n```\n\n## Output\n\n### Console output\n\nThis is an example of what you got in the console.\n\n```text\n$ python examples/testcase.py\n\nRunning tests...\n----------------------------------------------------------------------\n This test should be marked as error one. ... ERROR (0.000575)s\n This test should fail. ... FAIL (0.000564)s\n test_isupper (__main__.TestStringMethods) ... OK (0.000149)s\n This test should be skipped. ... SKIP (0.000067)s\n test_split (__main__.TestStringMethods) ... OK (0.000167)s\n test_upper (__main__.TestStringMethods) ... OK (0.000134)s\n\n======================================================================\nERROR [0.000575s]: This test should be marked as error one.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"examples/testcase.py\", line 23, in test_error\n raise ValueError\nValueError\n\n======================================================================\nFAIL [0.000564s]: This test should fail.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"examples/testcase.py\", line 27, in test_fail\n self.assertEqual(1, 2)\nAssertionError: 1 != 2\n\n----------------------------------------------------------------------\nRan 6 tests in 0.002s\n\nFAILED\n (Failures=1, Errors=1, Skipped=1)\n\nGenerating HTML reports...\nTemplate is not specified, load default template instead.\nReports generated: /Users/Leo/MyProjects/ApiTestEngine/src/pyunitreport/reports/example_dir/2017-07-26-23-33-49.html\n```\n\n### Html Output\n\n![html output](docs/html_output.gif)\n\n![html output](docs/html_output.png)\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/HttpRunner/PyUnitReport", "keywords": "HtmlTestRunner TestRunner Html Reports", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "PyUnitReport", "package_url": "https://pypi.org/project/PyUnitReport/", "platform": "", "project_url": "https://pypi.org/project/PyUnitReport/", "project_urls": { "Homepage": "https://github.com/HttpRunner/PyUnitReport" }, "release_url": "https://pypi.org/project/PyUnitReport/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "A unit test runner for Python, and generate HTML reports.", "version": "0.1.4" }, "last_serial": 3335100, "releases": { "0.1.3a0": [ { "comment_text": "", "digests": { "md5": "97c313338e98c85d8eee3bce7da2115e", "sha256": "dbca5e46c2cd682d5bfe7dfcce5a50085ea2d19aebba39058f085d2c39ee083a" }, "downloads": -1, "filename": "PyUnitReport-0.1.3a0-py3.6.egg", "has_sig": false, "md5_digest": "97c313338e98c85d8eee3bce7da2115e", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 19506, "upload_time": "2017-11-06T13:53:27", "url": "https://files.pythonhosted.org/packages/e1/5e/518c0ffe73aa6f2743af41250e3c97bdcc887d6c55c8409085a1f1a5d670/PyUnitReport-0.1.3a0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "b33288ab888546e7a9fb8182c06a24cc", "sha256": "9a2ce86186014e20787aa4cac2ee033916a15f704b78befb5f9301d7916bff49" }, "downloads": -1, "filename": "PyUnitReport-0.1.3a0.tar.gz", "has_sig": false, "md5_digest": "b33288ab888546e7a9fb8182c06a24cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8270, "upload_time": "2017-11-06T13:53:23", "url": "https://files.pythonhosted.org/packages/5b/71/e01234ba633ffa19f2a9c96cf695329fdc2a4207a275704514c2273fd6f7/PyUnitReport-0.1.3a0.tar.gz" } ], "0.1.3b0": [ { "comment_text": "", "digests": { "md5": "9664a7bed222d77eb4aadb77c110a17f", "sha256": "7e6418d610d0497174958a5a6766bd2e4f6b269a28be4f6a894e3d5ad1c06c7b" }, "downloads": -1, "filename": "PyUnitReport-0.1.3b0-py3.6.egg", "has_sig": false, "md5_digest": "9664a7bed222d77eb4aadb77c110a17f", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 19514, "upload_time": "2017-11-07T03:48:31", "url": "https://files.pythonhosted.org/packages/de/ef/c9c4a047ce04e5e79fe5568fd4633e52136123efe32f0d00a426b83bf884/PyUnitReport-0.1.3b0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "3c617ea22dc3d5486211b30e81fad7e5", "sha256": "1ab2e10455c77ea3723263c4cb96411f8e6ff7a7fb35c666883f1181047b79c9" }, "downloads": -1, "filename": "PyUnitReport-0.1.3b0.tar.gz", "has_sig": false, "md5_digest": "3c617ea22dc3d5486211b30e81fad7e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10872, "upload_time": "2017-11-07T03:48:28", "url": "https://files.pythonhosted.org/packages/e3/b7/279d1ad4f418725cda74ff45120c8b9bb35da3deca6580c3038044852459/PyUnitReport-0.1.3b0.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "f5f5733633756ebd672bd49a31175bca", "sha256": "78eae408bdc90f56417f7acd98cb54acaa5cfd6c7000d77e8baea98746155e5b" }, "downloads": -1, "filename": "pyunitreport-0.1.4-py3.3.egg", "has_sig": false, "md5_digest": "f5f5733633756ebd672bd49a31175bca", "packagetype": "bdist_egg", "python_version": "3.3", "requires_python": null, "size": 20162, "upload_time": "2017-11-15T12:35:28", "url": "https://files.pythonhosted.org/packages/dc/7a/3ac0a09534cd994c13ec44f87eb9f5be5cf332d96103d2de0d5433c3b1d1/pyunitreport-0.1.4-py3.3.egg" }, { "comment_text": "", "digests": { "md5": "5c9348b023e4195cd0bb3128d522136c", "sha256": "ebc1d44fae1aeea1ec54194159f6ba5cf1492a12a0d62094019c06cf0313afc8" }, "downloads": -1, "filename": "pyunitreport-0.1.4.tar.gz", "has_sig": false, "md5_digest": "5c9348b023e4195cd0bb3128d522136c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10879, "upload_time": "2017-11-15T12:35:26", "url": "https://files.pythonhosted.org/packages/b3/09/bb336fa5f231c2ee0acfef3ceeaca6bac5a565583af5056e549f26636656/pyunitreport-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f5f5733633756ebd672bd49a31175bca", "sha256": "78eae408bdc90f56417f7acd98cb54acaa5cfd6c7000d77e8baea98746155e5b" }, "downloads": -1, "filename": "pyunitreport-0.1.4-py3.3.egg", "has_sig": false, "md5_digest": "f5f5733633756ebd672bd49a31175bca", "packagetype": "bdist_egg", "python_version": "3.3", "requires_python": null, "size": 20162, "upload_time": "2017-11-15T12:35:28", "url": "https://files.pythonhosted.org/packages/dc/7a/3ac0a09534cd994c13ec44f87eb9f5be5cf332d96103d2de0d5433c3b1d1/pyunitreport-0.1.4-py3.3.egg" }, { "comment_text": "", "digests": { "md5": "5c9348b023e4195cd0bb3128d522136c", "sha256": "ebc1d44fae1aeea1ec54194159f6ba5cf1492a12a0d62094019c06cf0313afc8" }, "downloads": -1, "filename": "pyunitreport-0.1.4.tar.gz", "has_sig": false, "md5_digest": "5c9348b023e4195cd0bb3128d522136c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10879, "upload_time": "2017-11-15T12:35:26", "url": "https://files.pythonhosted.org/packages/b3/09/bb336fa5f231c2ee0acfef3ceeaca6bac5a565583af5056e549f26636656/pyunitreport-0.1.4.tar.gz" } ] }