{ "info": { "author": "Amy Hanlon", "author_email": "amy@venmo.com", "bugtrack_url": null, "classifiers": [], "description": "nose-seed-faker\n===============\n\nA nose plugin for seeding the\n`faker `__ package based on test names.\n\n::\n\n $ nosetests --with-seed-faker mytests/\n\nFaker is seeded at the beginning of each test based on the test name, so\neach test that uses faker will use the same fake data between test runs,\nregardless of test order.\n\nThis relies on the\n`behavior `__\nthat faker seeds a instance of random that is shared globally across\ninstances of the Faker class, so seeding *any* instance of Faker will\nseed *every* instance of Faker.\n\nFor example, these two tests use faker to generate fake email addresses:\n\n.. code:: python\n\n import unittest\n\n from faker import Faker\n\n fake = Faker()\n\n\n class TestEmail(unittest.TestCase):\n def test_one(self):\n email = fake.email()\n print(email)\n\n def test_two(self):\n email = fake.email()\n print(email)\n\nSince faker generates random email addresses, if we run ``test_one``\nmultiple times, we'll use different emails for each test run:\n\n::\n\n $ nosetests -v --nocapture tests.py:TestEmail.test_one tests.py:TestEmail.test_one\n test_one (tests.TestEmail) ... opouros@hermistondeckow.com\n ok\n test_one (tests.TestEmail) ... sgrady@hotmail.com\n ok\n\n ----------------------------------------------------------------------\n Ran 2 tests in 0.001s\n\n OK\n\nWhile this is good for increasing the surface area of emails we use in\nour tests, it can cause flaky tests -- a test could mysteriously fail,\nbut if you tried running it again to debug the failure, all of a sudden\nit's passing again!\n\n``nose-seed-faker`` solves this problem by seeding faker based on the\nname of each test. Using the plugin, if you run the same test multiple\ntimes, it'll use the same email address:\n\n::\n\n $ nosetests --with-seed-faker -v --nocapture tests.py:TestEmail.test_one tests.py:TestEmail.test_one\n test_one (tests.TestEmail) ... mitchel07@yost.com\n ok\n test_one (tests.TestEmail) ... mitchel07@yost.com\n ok\n\n ----------------------------------------------------------------------\n Ran 2 tests in 0.001s\n\n OK\n\nEach individual test will use a different email, so we still get a good\nsurface area of emails to use in our tests:\n\n::\n\n $ nosetests --with-seed-faker -v --nocapture tests.py\n test_one (tests.TestEmail) ... mitchel07@yost.com\n ok\n test_two (tests.TestEmail) ... kurt.bartell@yahoo.com\n ok\n\n ----------------------------------------------------------------------\n Ran 2 tests in 0.001s\n\n OK\n\nInstallation\n============\n\n::\n\n $ pip install nose-seed-faker\n\nWarning\n=======\n\nVersions ``0.5.2`` and lower of faker will seed the ``random`` module\nglobally.\n\nVersion ``0.5.3`` `fixes `__\nthis issue by seeding an instance of the ``random.Random`` class, but at\nthe time of this writing, this fix hasn't been released to PyPI yet.\n\nUntil version ``0.5.3`` is released on PyPI, you can install it like so:\n\n::\n\n $ pip install git+http://github.com/joke2k/faker.git@dabf922af72783ebd9d163611ab0f4f307156443#egg=fake-factory==0.5.3\n\n\nHistory\n=======\n\n0.1.2\n-----\n\nreleased 2015-06-30\n\n- initial release", "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/venmo/nose-seed-faker", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "nose-seed-faker", "package_url": "https://pypi.org/project/nose-seed-faker/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/nose-seed-faker/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/venmo/nose-seed-faker" }, "release_url": "https://pypi.org/project/nose-seed-faker/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "A Nose plugin that seeds the faker package.", "version": "0.1.2" }, "last_serial": 1614005, "releases": { "0.1.1": [], "0.1.2": [ { "comment_text": "", "digests": { "md5": "bb7565bcecdfcd0b978b342644ad4c93", "sha256": "89f2be74076d106b7403472ac238202da0b1e272656acf2fc36e8a47280b1231" }, "downloads": -1, "filename": "nose-seed-faker-0.1.2.macosx-10.9-x86_64.exe", "has_sig": false, "md5_digest": "bb7565bcecdfcd0b978b342644ad4c93", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 69554, "upload_time": "2015-06-30T23:24:51", "url": "https://files.pythonhosted.org/packages/13/72/6a5d025d60e91f2b6a814d9e18942afa31e472de3a3853ed2144c13b0ed4/nose-seed-faker-0.1.2.macosx-10.9-x86_64.exe" }, { "comment_text": "", "digests": { "md5": "e9b6c5ab75fe3ac17193fa54881dd94f", "sha256": "5721afc2838c478ae5ad8550d3716353bfd4cc7f10a71f5214c9ccc53ed78a5e" }, "downloads": -1, "filename": "nose-seed-faker-0.1.2.tar.gz", "has_sig": false, "md5_digest": "e9b6c5ab75fe3ac17193fa54881dd94f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4128, "upload_time": "2015-06-30T23:24:47", "url": "https://files.pythonhosted.org/packages/46/94/8cbe8d992d54059be6ab5e99fb77970159e3a5ea450a7a7d28f5f200cc17/nose-seed-faker-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bb7565bcecdfcd0b978b342644ad4c93", "sha256": "89f2be74076d106b7403472ac238202da0b1e272656acf2fc36e8a47280b1231" }, "downloads": -1, "filename": "nose-seed-faker-0.1.2.macosx-10.9-x86_64.exe", "has_sig": false, "md5_digest": "bb7565bcecdfcd0b978b342644ad4c93", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 69554, "upload_time": "2015-06-30T23:24:51", "url": "https://files.pythonhosted.org/packages/13/72/6a5d025d60e91f2b6a814d9e18942afa31e472de3a3853ed2144c13b0ed4/nose-seed-faker-0.1.2.macosx-10.9-x86_64.exe" }, { "comment_text": "", "digests": { "md5": "e9b6c5ab75fe3ac17193fa54881dd94f", "sha256": "5721afc2838c478ae5ad8550d3716353bfd4cc7f10a71f5214c9ccc53ed78a5e" }, "downloads": -1, "filename": "nose-seed-faker-0.1.2.tar.gz", "has_sig": false, "md5_digest": "e9b6c5ab75fe3ac17193fa54881dd94f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4128, "upload_time": "2015-06-30T23:24:47", "url": "https://files.pythonhosted.org/packages/46/94/8cbe8d992d54059be6ab5e99fb77970159e3a5ea450a7a7d28f5f200cc17/nose-seed-faker-0.1.2.tar.gz" } ] }