{ "info": { "author": "Tetsuya Morimoto", "author_email": "tetsuya.morimoto@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Quality Assurance", "Topic :: Software Development :: Testing", "Topic :: Utilities" ], "description": "Requirements\n------------\n\n* Python 2.7 or 3.3 and later\n\nFeatures\n--------\n\n* Provide **pytest.mark.randomize** function for generating random test data\n\nInstallation\n============\n\n::\n\n $ easy_install pytest-quickcheck # or\n $ pip install pytest-quickcheck\n\nQuick Start\n===========\n\nJust pass the signature of function to *randomize* marker.\nThe signature is represented a tuple consist of argument name and its type.\n\n::\n\n @pytest.mark.randomize(i1=int, i2=int, ncalls=1)\n def test_generate_ints(i1, i2):\n pass\n\nMore complex data structure::\n\n @pytest.mark.randomize(\n d1={'x': int, 'y': [str, (int, int)], 'z': {'x': str}}\n )\n def test_generate_dict(d1):\n pass\n\nThe *randomize* marker is able to use with *parametrize* marker.\n\n::\n\n @pytest.mark.parametrize(\"prime\", [2, 3, 5])\n @pytest.mark.randomize(i1=int, f1=float, ncalls=1)\n def test_gen_parametrize_with_randomize_int_float(prime, i1, f1):\n pass\n\nUsing command line option ``--randomize`` restricts only the *randomize* test.\n\n::\n\n $ py.test -v --randomize test_option.py \n ==========================================================================================\n test session starts\n ==========================================================================================\n test_option.py:5: test_normal SKIPPED\n test_option.py:8: test_generate_ints[74-22] PASSED\n\nUsage\n=====\n\nThere some options for each data type::\n\n $ py.test --markers\n @pytest.mark.randomize(argname=type, **options): mark the test function with\n random data generating any data type.\n There are options for each data type: (see doc for details)\n int: ['min_num', 'max_num']\n float: ['min_num', 'max_num', 'positive']\n str: ['encoding', 'fixed_length', 'min_length', 'max_length', 'str_attrs']\n list_of, nonempty_list_of, dict_of: ['items', 'min_items', 'max_items']\n\n* common option\n\n | **ncalls**: set the number of calls. Defaults to 3. (e.g. ncalls=5)\n | **choices**: choose from given sequence. (e.g. choices=[3, 5, 7])\n\n* int\n\n | **min_num**: lower limit for generating integer number. (e.g. min_num=0)\n | **max_num**: upper limit for generating integer number. (e.g. max_num=10)\n\n* float\n\n | **min_num**: lower limit for generating real number. (e.g. min_num=0.0)\n | **max_num**: upper limit for generating real number. (e.g. max_num=1.0)\n | **positive**: generate only positive real number if set to `True`.\n Defaults to `False`. (e.g. positive=True)\n\n* str\n\n | **encoding**: generate unicode string encoded given character code.\n (e.g. encoding=\"utf-8\") # for Python 2.x only\n | **fixed_length**: generate fixed length string. (e.g. fixed_length=8)\n | **max_length**: generate the string less than or equal to max length\n (e.g. max_length=32)\n | **str_attrs**: generate the string in given letters.\n set a tuple consist of attribute names in the `string module`_.\n (e.g. str_attrs=(\"digits\", \"punctuation\")\n\n* list_of, nonempty_list_of, dict_of\n\n | **items**: number of items.\n | **min_items**: lower limit on number of items.\n | **max_items**: upper limit on number of items.\n\nProbably, `tests/test_plugin_basic.py` is useful for\nlearning how to use these options.\n\n.. _string module: http://docs.python.org/library/string.html\n\nGenerating Collections\n======================\n\nTo generate a variable length list of items::\n\n from pytest import list_of\n\n @pytest.mark.randomize(l=list_of(int))\n def test_list_of(l):\n pass\n\nYou can control its size with the ``items``, ``min_items`` and\n``max_items`` options, or use the ``nonempty_list_of`` shortcut.\n\n::\n \n @pytest.mark.randomize(l=list_of(int, num_items=10))\n def test_list_of_length(l):\n assert len(l) == 10\n\n @pytest.mark.randomize(l=list_of(int, min_items=10, max_items=100))\n def test_list_of_minimum_length(l):\n assert len(l) >= 10\n\n from pytest import nonempty_list_of\n\n @pytest.mark.randomize(l=nonempty_list_of(int)\n def test_list_of_minimum_length(l):\n assert len(l) >= 1\n\nOptions for data types work as usual::\n\n @pytest.mark.randomize(l=list_of(str, num_items=10), choices=[\"a\", \"b\", \"c\"])\n def test_list_of(l):\n assert l[0] in [\"a\", \"b\", \"c\"]\n\n(Note what goes into the ``list_of()`` call and what goes outside.)\n\nYou can also generate a dict::\n\n from pytest import dict_of\n @pytest.mark.randomize(d=dict_of(str, int))\n def test_list_of(l):\n pass\n\n\nPython 3\n========\n\nFor Python 3, the signature of function is given as function annotation.\n\n::\n\n @pytest.mark.randomize(min_num=0, max_num=2, ncalls=5)\n def test_generate_int_anns(i1: int):\n pass\n\nMixed representation is also OK, but it might not be useful. \n\n::\n\n @pytest.mark.randomize(i1=int, fixed_length=8)\n def test_generate_arg_anns_mixed(i1, s1: str):\n pass\n\nSee also: `PEP 3107 -- Function Annotations`_\n\n.. _PEP 3107 -- Function Annotations: http://www.python.org/dev/peps/pep-3107/\n\nBackward Compatibility\n======================\n\nUnder 0.6 version, types were specified by strings containing the name\nof the type. It's still supported if you like.\n\n::\n\n @pytest.mark.randomize((\"i1\", \"int\"), (\"i2\", \"int\"), ncalls=1)\n\nChangeLog\n=========\n\n0.8.3 (2017-05-27)\n------------------\n\n* fix an issue related to pytest-3.1.0\n* drop supporting python 2.6 and 3.2\n\n0.8.2 (2015-03-02)\n------------------\n\n* transfer the code repository to pytest-dev\n\n0.8.1 (2014-12-25)\n------------------\n\n* support min_length for str data type\n* removed distribute dependency\n* add pytest-flakes testing\n\n0.8 (2013-12-08)\n----------------\n\n* fix use the parameter length for string generator even if the set of\n available characters is less than it (#2)\n\n* support new feature: Generating Collections from sonoflilit\n\n0.7 (2012-10-20)\n----------------\n\n* the types in the arguments are specified by the types themselves (#1)\n\n0.6 (2012-03-29)\n----------------\n* add generating data feature from function annotation\n\n0.5 (2012-03-18)\n----------------\n* first release", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/pytest-dev/pytest-quickcheck", "keywords": "test,pytest,quickcheck", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "pytest-quickcheck", "package_url": "https://pypi.org/project/pytest-quickcheck/", "platform": "linux", "project_url": "https://pypi.org/project/pytest-quickcheck/", "project_urls": { "Homepage": "https://bitbucket.org/pytest-dev/pytest-quickcheck" }, "release_url": "https://pypi.org/project/pytest-quickcheck/0.8.3/", "requires_dist": null, "requires_python": "", "summary": "pytest plugin to generate random data inspired by QuickCheck", "version": "0.8.3" }, "last_serial": 2902758, "releases": { "0.5": [ { "comment_text": "", "digests": { "md5": "e3f67a872c976d09f39b9f593fadac52", "sha256": "8ef3c07aa91f6af8c89c5f7c5b286edc70827822dc51be0fd32d3c3c7065b0a4" }, "downloads": -1, "filename": "pytest-quickcheck-0.5.tar.gz", "has_sig": false, "md5_digest": "e3f67a872c976d09f39b9f593fadac52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9892, "upload_time": "2012-03-19T03:48:25", "url": "https://files.pythonhosted.org/packages/b8/80/aac74f33ab79fa9ce31b4c07d7f1b53e745cfa96bf26f18d8abcb4221872/pytest-quickcheck-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "ba0fbbda7a7ddcee16ed4dd82ced5a0d", "sha256": "eacb2e4a215643e0feb77194a34b44ba3b7e31bccd658a4414876e5a4dbade85" }, "downloads": -1, "filename": "pytest-quickcheck-0.6.tar.gz", "has_sig": false, "md5_digest": "ba0fbbda7a7ddcee16ed4dd82ced5a0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10459, "upload_time": "2012-03-30T05:33:35", "url": "https://files.pythonhosted.org/packages/27/7b/d9119bc7cb9054aeac4986fd45a8255d79dd88d351191d74fe06a3c28938/pytest-quickcheck-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "d98cea6f205a44e000cdd2276439f8dc", "sha256": "f9846de4d599008a5bc93bc333b96c369b5a64b83de03754d15f7f3c74bff200" }, "downloads": -1, "filename": "pytest-quickcheck-0.7.tar.gz", "has_sig": false, "md5_digest": "d98cea6f205a44e000cdd2276439f8dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11355, "upload_time": "2012-10-20T06:20:26", "url": "https://files.pythonhosted.org/packages/84/ce/b3fcff60568f000f3d0f739a040122625305e14ec9ee7281412b633842a8/pytest-quickcheck-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "7f12df64977e692fa3c0d34975d5a3b6", "sha256": "53375baed9be2c47b2072287d6b66eb1a7f81458850fc8aabc9238659235a1b5" }, "downloads": -1, "filename": "pytest-quickcheck-0.8.tar.gz", "has_sig": false, "md5_digest": "7f12df64977e692fa3c0d34975d5a3b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18449, "upload_time": "2013-12-08T09:35:03", "url": "https://files.pythonhosted.org/packages/bb/27/2bcb44186207cc7a35582eca0ce81fc78e9f4160c0e3172f76080f0d318f/pytest-quickcheck-0.8.tar.gz" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "7152e8512e6ad0a8dcf6e972004b5337", "sha256": "a8453c24c188f39c27a256a52bce8f7cbc5ff69d0b5c3aec9c9eedb2cf12d2a1" }, "downloads": -1, "filename": "pytest-quickcheck-0.8.1.tar.gz", "has_sig": false, "md5_digest": "7152e8512e6ad0a8dcf6e972004b5337", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16486, "upload_time": "2014-12-25T01:34:00", "url": "https://files.pythonhosted.org/packages/9c/b1/2d372e3cfe6fa87519a939cc285ce62b16dbadb425a16c1abf53176b09ce/pytest-quickcheck-0.8.1.tar.gz" } ], "0.8.2": [ { "comment_text": "", "digests": { "md5": "e8be0267665999264848bd68668bfd87", "sha256": "036aad7ac5553a4416d9e85a9bfea6d989f6d7bf2a0f5798ae9f5addf827fc10" }, "downloads": -1, "filename": "pytest-quickcheck-0.8.2.tar.gz", "has_sig": false, "md5_digest": "e8be0267665999264848bd68668bfd87", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16687, "upload_time": "2015-03-01T17:15:26", "url": "https://files.pythonhosted.org/packages/50/87/e71a357f077f191483528889a116e3562f325a99cec41edb44f3ffae516b/pytest-quickcheck-0.8.2.tar.gz" } ], "0.8.3": [ { "comment_text": "", "digests": { "md5": "a5220ec5140d35d112e228b9d7965703", "sha256": "8f8061e8525ccf74ca6327ae0b89d4223829d36de90161dea22569f09cf1749f" }, "downloads": -1, "filename": "pytest-quickcheck-0.8.3.tar.gz", "has_sig": false, "md5_digest": "a5220ec5140d35d112e228b9d7965703", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17094, "upload_time": "2017-05-27T05:07:50", "url": "https://files.pythonhosted.org/packages/2f/ba/fbc2337202cc717716d2c31c853287f4960515069eb08e1a0871bb997f37/pytest-quickcheck-0.8.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a5220ec5140d35d112e228b9d7965703", "sha256": "8f8061e8525ccf74ca6327ae0b89d4223829d36de90161dea22569f09cf1749f" }, "downloads": -1, "filename": "pytest-quickcheck-0.8.3.tar.gz", "has_sig": false, "md5_digest": "a5220ec5140d35d112e228b9d7965703", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17094, "upload_time": "2017-05-27T05:07:50", "url": "https://files.pythonhosted.org/packages/2f/ba/fbc2337202cc717716d2c31c853287f4960515069eb08e1a0871bb997f37/pytest-quickcheck-0.8.3.tar.gz" } ] }