{ "info": { "author": "Ying Ni", "author_email": "niying7@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: Jython", "Topic :: Software Development :: Testing" ], "description": "INTRODUCTION\n============\n\nunishark extends unittest (to be accurate, unittest2) in the\nfollowing ways:\n\n- Customizing test suites with dictionary config (or yaml/json like config).\n- Running the tests concurrently at different levels.\n- Generating polished test reports in HTML/XUnit formats.\n- Offering data-driven decorator to accelerate tests writing.\n\nFor existing unittests, the first three features could be obtained immediately with a single config, without changing any test code.\n\nThe Test Config\n---------------\n\nHere is an example config in YAML format (you could also write it\ndirectly in a dict()):\n\n.. code:: yaml\n\n suites:\n my_suite_name_1:\n package: my.package.name\n groups:\n my_group_1:\n granularity: module\n modules: [test_module1, test_module2]\n except_classes: [test_module2.MyTestClass3]\n except_methods: [test_module1.MyTestClass1.test_1]\n my_group_2:\n granularity: class\n disable: False\n classes: [test_module3.MyTestClass5]\n except_methods: [test_module3.MyTestClass5.test_11]\n concurrency:\n level: module\n max_workers: 2\n my_suite_name_2:\n package: my.package.name\n groups:\n my_group_1:\n granularity: method\n methods: [test_module3.MyTestClass6.test_13, test_module3.MyTestClass7.test_15]\n concurrency:\n level: class\n max_workers: 2\n my_suite_name_3:\n package: another.package.name\n groups:\n group_1:\n granularity: package\n pattern: '(\\w+\\.){2}test\\w*'\n except_modules: [module1, module2]\n except_classes: [module3.Class1, module3.Class3]\n except_methods: [module3.Class2.test_1, module4.Class2.test_5]\n concurrency:\n level: method\n max_workers: 20\n reporters:\n html:\n class: unishark.HtmlReporter\n kwargs:\n dest: logs\n overview_title: 'Example Report'\n overview_description: 'This is an example report'\n xunit:\n class: unishark.XUnitReporter\n kwargs:\n summary_title: 'Example Report'\n\n test:\n suites: [my_suite_name_1, my_suite_name_2, my_suite_name_3]\n concurrency:\n type: processes\n max_workers: 3\n reporters: [html, xunit]\n name_pattern: '^test\\w*'\n\nIt configures 3 test suites with some of the test cases excluded, and running the defined set of tests concurrently, and generating both HTML and XUnit (default JUnit) format reports at the end of tests.\n\nNOTE: In 0.2.x versions, 'max_workers' was set directly under 'test', and 'max_workers' and 'concurrency_level' were set directly under '{suite name}'.\n\nTo run it, simply add the following code:\n\n.. code:: python\n\n import unishark\n import yaml\n\n if __name__ == '__main__':\n with open('your_yaml_config_file', 'r') as f:\n dict_conf = yaml.load(f.read()) # use a 3rd party yaml parser, e.g., PyYAML\n program = unishark.DefaultTestProgram(dict_conf)\n unishark.main(program)\n\nA HTML report example can be found Here_.\n\n.. _Here: https://github.com/twitter/unishark\n\nData Driven\n-----------\n\nHere are some effects of using @unishark.data\\_driven.\n\n\u2018Json\u2019 style data-driven:\n\n.. code:: python\n\n @unishark.data_driven(*[{'userid': 1, 'passwd': 'abc'}, {'userid': 2, 'passwd': 'def'}])\n def test_data_driven(self, **param):\n print('userid: %d, passwd: %s' % (param['userid'], param['passwd']))\n\nResults:\n\n::\n\n userid: 1, passwd: abc\n userid: 2, passwd: def\n\n\u2018Args\u2019 style data-driven:\n\n.. code:: python\n\n @unishark.data_driven(userid=[1, 2, 3, 4], passwd=['a', 'b', 'c', 'd'])\n def test_data_driven(self, **param):\n print('userid: %d, passwd: %s' % (param['userid'], param['passwd']))\n\nResults:\n\n::\n\n userid: 1, passwd: a\n userid: 2, passwd: b\n userid: 3, passwd: c\n userid: 4, passwd: d\n\nCross-multiply data-driven:\n\n.. code:: python\n\n @unishark.data_driven(left=list(range(10)))\n @unishark.data_driven(right=list(range(10)))\n def test_data_driven(self, **param):\n l = param['left']\n r = param['right']\n print('%d x %d = %d' % (l, r, l * r))\n\nResults:\n\n::\n\n 0 x 1 = 0\n 0 x 2 = 0\n ...\n 1 x 0 = 0\n 1 x 1 = 1\n 1 x 2 = 2\n ...\n ...\n 9 x 8 = 72\n 9 x 9 = 81\n\nYou can get the permutations (with repetition) of the parameters values\nby doing:\n\n.. code:: python\n\n @unishark.data_driven(...)\n @unishark.data_driven(...)\n @unishark.data_driven(...)\n ...\n\nMulti-threads data-driven in 'json style':\n\n.. code:: python\n\n @unishark.multi_threading_data_driven(2, *[{'userid': 1, 'passwd': 'abc'}, {'userid': 2, 'passwd': 'def'}])\n def test_data_driven(self, **param):\n print('userid: %d, passwd: %s' % (param['userid'], param['passwd']))\n\nResults: same results as using unishark.data_driven, but up to 2 threads are spawned, each running the test with a set of inputs (userid, passwd).\n\nMulti-threads data-driven in 'args style':\n\n.. code:: python\n\n @unishark.multi_threading_data_driven(5, time=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1])\n def test_data_driven(self, **param):\n sleep(param['time'])\n\nResults: 5 threads are spawned to run the test with 10 sets of inputs concurrently (only sleep 1 sec in each thread).\nIt takes about 2 sec in total (10 sec if using unishark.data_driven) to run.\n\nFor more information please visit the Project_Home_ and read README.md.\n\n.. _Project_Home: https://github.com/twitter/unishark\n\nCHANGELOG\n=========\n\n0.3.2 (2015-11-24)\n------------------\n\n - added multiprocessing suites (which can bypass CPython's GIL and utilize multi-cores).\n - modified result, runner and reporter classes to be picklable for multiprocessing.\n - supported running with Jython.\n\n\n0.3.1 (2015-11-12)\n------------------\n\n - fixed the issue of still running test methods even when setUpClass/setUpModule raises exception in concurrency mode.\n - fixed error descriptions of class or module level fixtures when they raise exceptions.\n\n\n0.3.0 (2015-11-06)\n------------------\n\n - rewrote concurrent execution model. Now test fixtures setUpModule/tearDownModule setUpClass/tearDownClass will be executed once and only once no matter what concurrency level(module/class/method) of a suite is. Fixed the problem that module fixtures were executed multiple times when concurrency level was 'class' or 'method', and class fixtures were executed multiple times when concurrency level was 'method'.\n - changed the format of the concurrency-related settings in the dict config. Now 'max_workers' and 'level' are keys in the 'concurrency' sub-dict.\n - moved BufferedTestResult class from the runner module to the new result module which makes more sense.\n\n\n0.2.3 (2015-10-01)\n------------------\n\n - enabled 'module' and 'method' level concurrent execution in a suite.\n\n\n0.2.2 (2015-08-12)\n------------------\n\n - support loading tests from a package with pattern matching, and excluding modules/classes/methods from the loaded tests.\n - add load_tests_from_package and load_tests_from_modules api.\n - rename load_test_from_dict to load_tests_from_dict.\n - fix that verbose stdout mode does not print test method doc string.\n - fix that tests loaded with method granularity are not filtered by method name pattern.\n - less strict dependency versions.\n\n\n0.2.1 (2015-05-11)\n------------------\n\n - support data-driven with multi-threads.\n\n\n0.2.0 (2015-04-04)\n------------------\n\n - support running tests in parallel.\n\n - support configuring test suites, test reporters and concurrent tests in a single dict/yaml config.\n\n - improve HtmlReporter and XUnitReporter classes to be thread-safe.\n\n - allow user to generate reports with their own report templates.\n\n - allow user to filter loaded test cases by setting method name prefix in the test config.\n\n - bugs fix.\n\n - improve documentation.\n\n\n0.1.2 (2015-03-25)\n------------------\n\n - hotfix for setup.py (broken auto-downloading dependencies)\n\n - bugs fix.\n\n\n0.1.1 (2015-03-24)\n------------------\n\n - support loading customized test suites.\n\n - support a thread-safe string io buffer to buffer logging stream during the test running.\n\n - support writing logs, exceptions into generated HTML/XUnit reports.\n\n - offer a data-driven decorator.\n\n - initial setup (documentation, setup.py, travis CI, coveralls, etc.).", "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/twitter/unishark", "keywords": "test framework,unittest extension,concurrent,data driven", "license": "Apache License, Version 2.0", "maintainer": null, "maintainer_email": null, "name": "unishark", "package_url": "https://pypi.org/project/unishark/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/unishark/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/twitter/unishark" }, "release_url": "https://pypi.org/project/unishark/0.3.2/", "requires_dist": null, "requires_python": null, "summary": "A test framework extending unittest, providing flexible test suites config, concurrent execution, Html/XUnit reports, and data driven utility.", "version": "0.3.2" }, "last_serial": 1832031, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "9012fb8a486a3cf828eef1173d31c1a0", "sha256": "d1ff03fd61298fdc4b7bd203c9d61a2792a5160b2785cfef5ee8916666340926" }, "downloads": -1, "filename": "unishark-0.1.1.tar.gz", "has_sig": false, "md5_digest": "9012fb8a486a3cf828eef1173d31c1a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11611, "upload_time": "2015-03-24T21:25:43", "url": "https://files.pythonhosted.org/packages/bf/cc/63aa3235bfc18ae14098a563e0db4a5638f87b800da37ab96a5ee135b61f/unishark-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "2984d2a8dce5a4e5492658532ea7d287", "sha256": "81c41c3672aef51271ac39b288fa3dfb3a63cf15aa5891e34c126e8d6f65e1c3" }, "downloads": -1, "filename": "unishark-0.1.2.tar.gz", "has_sig": false, "md5_digest": "2984d2a8dce5a4e5492658532ea7d287", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11720, "upload_time": "2015-03-26T00:57:51", "url": "https://files.pythonhosted.org/packages/e2/5f/051a1a53621f31713a8c61be5d1f90c618fe35b49616308af923a6aef23a/unishark-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "65b2ee734d49f01628224c6c96ffe485", "sha256": "b7b2089320e8ae6eb87f2d9af26ba257019f6508614bb08b04ab2b8a0aa9c7c2" }, "downloads": -1, "filename": "unishark-0.2.0.tar.gz", "has_sig": false, "md5_digest": "65b2ee734d49f01628224c6c96ffe485", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17350, "upload_time": "2015-04-04T22:40:58", "url": "https://files.pythonhosted.org/packages/e0/a4/760d7384d9a699888a7fdac8f8d225d45b5b2f8401d028d8308e6e979e0e/unishark-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "b0a841391b1136cb6f0610a42bf72edf", "sha256": "6a32bc851db3c71935591c09c15effc2be462813150742b193efd7b821030862" }, "downloads": -1, "filename": "unishark-0.2.1.tar.gz", "has_sig": false, "md5_digest": "b0a841391b1136cb6f0610a42bf72edf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18215, "upload_time": "2015-05-12T15:12:33", "url": "https://files.pythonhosted.org/packages/52/76/c11f99db9b48cdf2b41a067db3709f53651dedc791ba5765941818826593/unishark-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "ba908096b6f69d70097a900e24bac229", "sha256": "5f17f25e9f6fb76379a8ba603ed975d6423f3f1b7d1e1ab6c9888962a4e92011" }, "downloads": -1, "filename": "unishark-0.2.2.tar.gz", "has_sig": false, "md5_digest": "ba908096b6f69d70097a900e24bac229", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20180, "upload_time": "2015-08-12T23:20:06", "url": "https://files.pythonhosted.org/packages/85/ce/8208482d27c0ac06ad5d9c2672ce1f417e3713dfabef47e0ded8f555cfac/unishark-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "5a19bf038b5284112fe4d8d619393d7b", "sha256": "fdf80479031bb691817bd3c71e8013de4f008a38b01d9a20245a0d29849e3028" }, "downloads": -1, "filename": "unishark-0.2.3.tar.gz", "has_sig": false, "md5_digest": "5a19bf038b5284112fe4d8d619393d7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20506, "upload_time": "2015-10-01T04:54:55", "url": "https://files.pythonhosted.org/packages/76/96/c9636f39e52c1be05dbdd230d4aa9f646b3f17f277f384e01dd09fbd588b/unishark-0.2.3.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "7b34697911f57974461aa88232eb58bf", "sha256": "05f595e32f145810a0ae69e34fb9d03ee2ae3099302b242fd0d762a095c88b6c" }, "downloads": -1, "filename": "unishark-0.3.0.tar.gz", "has_sig": false, "md5_digest": "7b34697911f57974461aa88232eb58bf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23576, "upload_time": "2015-11-06T20:39:13", "url": "https://files.pythonhosted.org/packages/de/8b/2f0a4b7e1d290873d1c3e774b8a590fa691dc931e5ce5933302dcde0a4f6/unishark-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "bab5f13b358ec0e28f51ca1cb2194161", "sha256": "adac0cd703026101534c55030d9f24c72043765741359690cabc4e669fffbab0" }, "downloads": -1, "filename": "unishark-0.3.1.tar.gz", "has_sig": false, "md5_digest": "bab5f13b358ec0e28f51ca1cb2194161", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23891, "upload_time": "2015-11-12T15:28:03", "url": "https://files.pythonhosted.org/packages/cc/64/9c2248558919c9fbbe4d4569cffda7f7e9eeb8b63a6bf467179277b685d6/unishark-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "9507d9ccf8177077ae2923d951ee57be", "sha256": "0890c142c7368ec53c7093882f36b27e2d4f6344d9128b8582e9a6aad2fa6a22" }, "downloads": -1, "filename": "unishark-0.3.2.tar.gz", "has_sig": false, "md5_digest": "9507d9ccf8177077ae2923d951ee57be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25477, "upload_time": "2015-11-24T20:56:53", "url": "https://files.pythonhosted.org/packages/a3/0f/bfbdb5fc68b4e89753bb3076936bdae7f19097c38c82b116a93ca7c2695f/unishark-0.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9507d9ccf8177077ae2923d951ee57be", "sha256": "0890c142c7368ec53c7093882f36b27e2d4f6344d9128b8582e9a6aad2fa6a22" }, "downloads": -1, "filename": "unishark-0.3.2.tar.gz", "has_sig": false, "md5_digest": "9507d9ccf8177077ae2923d951ee57be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25477, "upload_time": "2015-11-24T20:56:53", "url": "https://files.pythonhosted.org/packages/a3/0f/bfbdb5fc68b4e89753bb3076936bdae7f19097c38c82b116a93ca7c2695f/unishark-0.3.2.tar.gz" } ] }