{ "info": { "author": "Jared Windover", "author_email": "jaredwindover@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Topic :: Software Development :: Testing" ], "description": "========\r\nGenTests\r\n========\r\n\r\nA module for generating tests from data with unittest\r\n\r\nInstallation:\r\n=============\r\n\r\nInstall using pip::\r\n\r\n\tpip install gentests\r\n\r\nExample:\r\n========\r\n\r\nThe following test code will generate 10 tests::\r\n\r\n\timport unittest\r\n\tfrom gentests import gentests, vals\r\n\r\n\tdef my_less_than(a,b):\r\n\t '''Broken function to test'''\r\n\t return a <= b\r\n\r\n\t@gentests\r\n\tclass TestSomething(unittest.TestCase):\r\n\r\n\r\n\t @vals([\r\n\t 'val_0',\r\n\t 'val_1',\r\n\t 'val_2'\r\n\t ])\r\n\t def test_False(self, value):\r\n\t '''Test that fails'''\r\n\t self.assertFalse(True)\r\n\r\n\t @vals([\r\n\t 'val_0',\r\n\t 'val_1',\r\n\t 'val_2'\r\n\t ])\r\n\t def test_True(self, value):\r\n\t '''Test that passes'''\r\n\t self.assertTrue(True)\r\n\r\n\t def name_test(original_name, left, right, result):\r\n\t '''Explicitly name our tests based on our arguments'''\r\n\t return '{0}_my_less_than_{1}_{2}_is_{3}'.format(\r\n\t original_name,\r\n\t str(left),\r\n\t str(right),\r\n\t str(result)\r\n\t )\r\n\r\n\t @vals([\r\n\t (0, 1, True),\r\n\t (0, 0, False), #Fails\r\n\t (0, 2, True),\r\n\t (2, 1, False),\r\n\t ], name=name_test) #pass optional naming function\r\n\t def test_MyLessThan(self, left, right, result):\r\n\t '''Test where some pass and some fail'''\r\n\t self.assertEqual(my_less_than(left, right), result)\r\n\r\n\tif __name__ == '__main__':\r\n\t unittest.main()\r\n\r\nthat produce the following output::\r\n\r\n\tFFFF......\r\n\t======================================================================\r\n\tFAIL: test_False_gentest_0 (test.TestSomething)\r\n\t----------------------------------------------------------------------\r\n\tTraceback (most recent call last):\r\n\t File \"C:\\Users\\Redirection\\windoj9\\Documents\\repos\\GenTests\\gentests.py\", line 17, in \r\n\t return lambda other_self: base_func(other_self, *args)\r\n\t File \"C:\\Users\\Redirection\\windoj9\\Documents\\repos\\GenTests\\test.py\", line 19, in test_False\r\n\t self.assertFalse(True)\r\n\tAssertionError: True is not false\r\n\r\n\t======================================================================\r\n\tFAIL: test_False_gentest_1 (test.TestSomething)\r\n\t----------------------------------------------------------------------\r\n\tTraceback (most recent call last):\r\n\t File \"C:\\Users\\Redirection\\windoj9\\Documents\\repos\\GenTests\\gentests.py\", line 17, in \r\n\t return lambda other_self: base_func(other_self, *args)\r\n\t File \"C:\\Users\\Redirection\\windoj9\\Documents\\repos\\GenTests\\test.py\", line 19, in test_False\r\n\t self.assertFalse(True)\r\n\tAssertionError: True is not false\r\n\r\n\t======================================================================\r\n\tFAIL: test_False_gentest_2 (test.TestSomething)\r\n\t----------------------------------------------------------------------\r\n\tTraceback (most recent call last):\r\n\t File \"C:\\Users\\Redirection\\windoj9\\Documents\\repos\\GenTests\\gentests.py\", line 17, in \r\n\t return lambda other_self: base_func(other_self, *args)\r\n\t File \"C:\\Users\\Redirection\\windoj9\\Documents\\repos\\GenTests\\test.py\", line 19, in test_False\r\n\t self.assertFalse(True)\r\n\tAssertionError: True is not false\r\n\r\n\t======================================================================\r\n\tFAIL: test_MyLessThan_my_less_than_0_0_is_False (test.TestSomething)\r\n\t----------------------------------------------------------------------\r\n\tTraceback (most recent call last):\r\n\t File \"C:\\Users\\Redirection\\windoj9\\Documents\\repos\\GenTests\\gentests.py\", line 17, in \r\n\t return lambda other_self: base_func(other_self, *args)\r\n\t File \"C:\\Users\\Redirection\\windoj9\\Documents\\repos\\GenTests\\test.py\", line 47, in test_MyLessThan\r\n\t self.assertEqual(my_less_than(left, right), result)\r\n\tAssertionError: True != False\r\n\r\n\t----------------------------------------------------------------------\r\n\tRan 10 tests in 0.006s\r\n\r\n\tFAILED (failures=4)\r\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/jaredwindover/GenTests", "keywords": "test generation testing unit unittest data theory", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "gentests", "package_url": "https://pypi.org/project/gentests/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/gentests/", "project_urls": { "Homepage": "https://github.com/jaredwindover/GenTests" }, "release_url": "https://pypi.org/project/gentests/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "A module for generating tests from data with unittest", "version": "1.0.0" }, "last_serial": 2552057, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "7ff1361a419220db670f47436f612135", "sha256": "73a1f594b398d184b4cc078109ae32d495e1635e844275e4cd6e54a86f46c126" }, "downloads": -1, "filename": "gentests-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7ff1361a419220db670f47436f612135", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2780, "upload_time": "2017-01-03T18:08:22", "url": "https://files.pythonhosted.org/packages/5a/27/27af3b549c19e8b01c856003661e68bdb03e95415fc5f4850529d1eac534/gentests-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "90808d197c253bde586cb76c78cdface", "sha256": "88100d83754aa33c9c1f27906e3c41ee859c93c0f31810f9985f2f923442db3a" }, "downloads": -1, "filename": "gentests-1.0.0.zip", "has_sig": false, "md5_digest": "90808d197c253bde586cb76c78cdface", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3992, "upload_time": "2017-01-03T18:08:24", "url": "https://files.pythonhosted.org/packages/3c/51/c683e6e497838b5b2e9526b1bd071148d34bdd212b315f2029d35762a1af/gentests-1.0.0.zip" } ], "1.0.0.dev1": [ { "comment_text": "", "digests": { "md5": "77490afd36f2340a48185c3db2589e29", "sha256": "d2cf5c886e78ee955986404592c3df323572227cf1014b5c06d39a03fef73d20" }, "downloads": -1, "filename": "gentests-1.0.0.dev1-py3-none-any.whl", "has_sig": false, "md5_digest": "77490afd36f2340a48185c3db2589e29", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2839, "upload_time": "2017-01-03T17:50:21", "url": "https://files.pythonhosted.org/packages/c0/42/2378910fb65139898146c17c9e8c8c330b852f9ce1b009ecf215adaab9f4/gentests-1.0.0.dev1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "37a35fef04f3e261cb8093f4b8acf1b0", "sha256": "10f23806b804b8659a91992a00e422ee1ce8d7ada301ea19160ade2dcbeece2c" }, "downloads": -1, "filename": "gentests-1.0.0.dev1.zip", "has_sig": false, "md5_digest": "37a35fef04f3e261cb8093f4b8acf1b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4025, "upload_time": "2017-01-03T17:50:23", "url": "https://files.pythonhosted.org/packages/c5/3f/ff5383bc822270e9ca4ff054507c5e514ce02c3b3df65204f940d696c94a/gentests-1.0.0.dev1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7ff1361a419220db670f47436f612135", "sha256": "73a1f594b398d184b4cc078109ae32d495e1635e844275e4cd6e54a86f46c126" }, "downloads": -1, "filename": "gentests-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7ff1361a419220db670f47436f612135", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2780, "upload_time": "2017-01-03T18:08:22", "url": "https://files.pythonhosted.org/packages/5a/27/27af3b549c19e8b01c856003661e68bdb03e95415fc5f4850529d1eac534/gentests-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "90808d197c253bde586cb76c78cdface", "sha256": "88100d83754aa33c9c1f27906e3c41ee859c93c0f31810f9985f2f923442db3a" }, "downloads": -1, "filename": "gentests-1.0.0.zip", "has_sig": false, "md5_digest": "90808d197c253bde586cb76c78cdface", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3992, "upload_time": "2017-01-03T18:08:24", "url": "https://files.pythonhosted.org/packages/3c/51/c683e6e497838b5b2e9526b1bd071148d34bdd212b315f2029d35762a1af/gentests-1.0.0.zip" } ] }