{ "info": { "author": "Igor `idle sign` Starikov", "author_email": "idlesign@yandex.ru", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Pytest", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Testing" ], "description": "pytest-race\n===========\nhttps://github.com/idlesign/pytest-race\n\n.. image:: https://img.shields.io/pypi/v/pytest-race.svg\n :target: https://pypi.python.org/pypi/pytest-race\n\n.. image:: https://img.shields.io/pypi/dm/pytest-race.svg\n :target: https://pypi.python.org/pypi/pytest-race\n\n.. image:: https://img.shields.io/pypi/l/pytest-race.svg\n :target: https://pypi.python.org/pypi/pytest-race\n\n.. image:: https://img.shields.io/coveralls/idlesign/pytest-race/master.svg\n :target: https://coveralls.io/r/idlesign/pytest-race\n\n.. image:: https://img.shields.io/travis/idlesign/pytest-race/master.svg\n :target: https://travis-ci.org/idlesign/pytest-race\n\n.. image:: https://landscape.io/github/idlesign/pytest-race/master/landscape.svg?style=flat\n :target: https://landscape.io/github/idlesign/pytest-race/master\n\n\nDescription\n-----------\n\n*Race conditions tester for pytest*\n\nIntroduces **start_race** fixture to run race condition tests.\n\n\nRequirements\n------------\n\n* Python 2.7+, 3.3+\n* pytest 2.9.0+\n\n\nUsage\n-----\n\nYou can use **start_race** fixture in your tests as follows:\n\n.. code-block:: python\n\n from time import sleep\n\n ACCUMULATOR = 0 # This global var is race conditions prone.\n\n def test_race(start_race):\n from random import randint\n\n def actual_test():\n global ACCUMULATOR\n\n increment = randint(1, 10000)\n\n accumulator = ACCUMULATOR\n sleep(1) # Simulate some lag.\n ACCUMULATOR += increment\n\n # By that moment ACCUMULATOR should have been updated\n # by another thread. Let's try to prove it.\n\n # Using simple `assert` as usual for pytest.\n assert accumulator + increment == ACCUMULATOR\n\n # Let's run `actual_test` in 2 threads.\n start_race(threads_num=2, target=actual_test)\n\n\n**start_race** accepts the following arguments:\n\n* **threads_num** - number of threads to run simultaneously.\n* **target** - actual test callable to run in threads.\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/idlesign/pytest-race", "keywords": "", "license": "BSD 3-Clause License", "maintainer": "", "maintainer_email": "", "name": "pytest-race", "package_url": "https://pypi.org/project/pytest-race/", "platform": "", "project_url": "https://pypi.org/project/pytest-race/", "project_urls": { "Homepage": "https://github.com/idlesign/pytest-race" }, "release_url": "https://pypi.org/project/pytest-race/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Race conditions tester for pytest", "version": "0.1.1" }, "last_serial": 2473794, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "c23dbfd477b60c27be671bc8fc232fae", "sha256": "4bb633aa217cd5e0950cbb6554c339ab0a777058b630d1af537d495ee867ba4f" }, "downloads": -1, "filename": "pytest_race-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c23dbfd477b60c27be671bc8fc232fae", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4924, "upload_time": "2016-11-20T13:12:02", "url": "https://files.pythonhosted.org/packages/03/06/f4d26af70490a32fde32ed8b2add6b04b715e455198a6159085855d3134e/pytest_race-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "17c0382d746d1c700312ee06507e3e1c", "sha256": "6ffaca299881bb6b15f52b39e14d191ae44c489ec23400ce26222b0eb8de40c4" }, "downloads": -1, "filename": "pytest-race-0.1.0.tar.gz", "has_sig": false, "md5_digest": "17c0382d746d1c700312ee06507e3e1c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4611, "upload_time": "2016-11-20T13:11:59", "url": "https://files.pythonhosted.org/packages/63/d4/3719cd8503d5b6618820dff8d847095b0e350d00bf339e1ade395d8b4441/pytest-race-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "c45abd08eb747e5ac4d7b98c5209e203", "sha256": "655ba41001e9dc361ff318bb4da3ce394dd90b6e188379ffa3587c0cd8c77b2a" }, "downloads": -1, "filename": "pytest_race-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c45abd08eb747e5ac4d7b98c5209e203", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4946, "upload_time": "2016-11-21T14:03:08", "url": "https://files.pythonhosted.org/packages/b1/e3/57e2d2edbd753f45ae24f3c82d723b0ce88d2237103bafe30414cde53159/pytest_race-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ea8e358b30cb278c448b9a18351fcb15", "sha256": "c49e437ba684c6d65c7f1b9719f2d29bc65ac81ceb20edea67bb5cee4271eebf" }, "downloads": -1, "filename": "pytest-race-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ea8e358b30cb278c448b9a18351fcb15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4638, "upload_time": "2016-11-21T14:03:05", "url": "https://files.pythonhosted.org/packages/21/c9/54e1ef89ab37b1053b69e13f03e88e1e45cd6ad8e5467a877cc754455f92/pytest-race-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c45abd08eb747e5ac4d7b98c5209e203", "sha256": "655ba41001e9dc361ff318bb4da3ce394dd90b6e188379ffa3587c0cd8c77b2a" }, "downloads": -1, "filename": "pytest_race-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c45abd08eb747e5ac4d7b98c5209e203", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4946, "upload_time": "2016-11-21T14:03:08", "url": "https://files.pythonhosted.org/packages/b1/e3/57e2d2edbd753f45ae24f3c82d723b0ce88d2237103bafe30414cde53159/pytest_race-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ea8e358b30cb278c448b9a18351fcb15", "sha256": "c49e437ba684c6d65c7f1b9719f2d29bc65ac81ceb20edea67bb5cee4271eebf" }, "downloads": -1, "filename": "pytest-race-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ea8e358b30cb278c448b9a18351fcb15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4638, "upload_time": "2016-11-21T14:03:05", "url": "https://files.pythonhosted.org/packages/21/c9/54e1ef89ab37b1053b69e13f03e88e1e45cd6ad8e5467a877cc754455f92/pytest-race-0.1.1.tar.gz" } ] }