{ "info": { "author": "Eyal Posener", "author_email": "posener@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "mock_import\r\n===========\r\n\r\n.. image:: https://travis-ci.org/posener/mock-import.svg?branch=master\r\n :target: https://travis-ci.org/posener/mock-import\r\n\r\n.. image:: https://badge.fury.io/py/mock-import.svg\r\n :target: https://pypi.python.org/pypi/mock-import\r\n\r\nA helper mocking function to mask ``ImportError`` s on a scoped code.\r\nFailed imports will be ignored, unless specified by the *do_not_mock* argument.\r\n\r\nInstallation\r\n------------\r\n\r\nUsing pip: ``pip install mock-import``\r\n\r\nUsage\r\n-----\r\n\r\nImport:\r\n >>> from mock_import import mock_import\r\n\r\nMocking import for a code block:\r\n >>> with mock_import():\r\n ... import no_such_module # Won't raise ImportError\r\n ... no_such_module.no_such_function() # Won't raise AttributeError\r\n\r\n\r\nMocking import as a decorator:\r\n >>> @mock_import()\r\n ... def method():\r\n ... import no_such_module # Won't raise ImportError\r\n ... no_such_module.no_such_function() # Won't raise AttributeError\r\n\r\n >>> import no_such_module # raises ImportError\r\n\r\nMaking an exception:\r\n >>> with mock_import(do_not_mock='no_such_module'):\r\n ... import no_such_other_module # Won't raise ImportError\r\n ... import no_such_module # Will raise ImportError\r\n\r\n >>> with mock_import(do_not_mock=['nsm1', 'nsm2']):\r\n ... import nsm # Won't raise ImportError\r\n ... import nsm1 # Will raise ImportError\r\n ... import nsm2 # Will raise ImportError", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/posener/mock-import.git", "keywords": "mock import", "license": "", "maintainer": "", "maintainer_email": "", "name": "mock-import", "package_url": "https://pypi.org/project/mock-import/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mock-import/", "project_urls": { "Homepage": "http://github.com/posener/mock-import.git" }, "release_url": "https://pypi.org/project/mock-import/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "A helper mocking function to mask ImportErrors", "version": "0.0.3" }, "last_serial": 2346947, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "f09a50c8db257b0ab4f755131e3fc890", "sha256": "88436ed945cdc64afee893fb88073050ab2e7ab497beaf9995a8d5a92bce3b18" }, "downloads": -1, "filename": "mock-import-0.0.1.tar.gz", "has_sig": false, "md5_digest": "f09a50c8db257b0ab4f755131e3fc890", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1673, "upload_time": "2016-09-16T13:43:53", "url": "https://files.pythonhosted.org/packages/3a/91/969fa815ae1e53770ed60b1fd86fcdec997ef8fd49b2848c35d4020eada7/mock-import-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "6c4c7a8815b783e9d9a80fcf485901ed", "sha256": "4950147e2323cc0ad122e2774a27e8f2f3157f7a6e34f0b43ba15f681cb6a0ae" }, "downloads": -1, "filename": "mock-import-0.0.2.tar.gz", "has_sig": false, "md5_digest": "6c4c7a8815b783e9d9a80fcf485901ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1752, "upload_time": "2016-09-16T14:39:55", "url": "https://files.pythonhosted.org/packages/56/68/d1d4aa15cee51c2fc3b0e85953b4bf2a84451e387487372d7a5632fa5937/mock-import-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "0f37fc6b6b8bfb901f05ee94db9c5978", "sha256": "a29586f195c872d3fdcf1184230ae248c6432d2b453f7052c6f9a21bf7073d22" }, "downloads": -1, "filename": "mock-import-0.0.3.tar.gz", "has_sig": false, "md5_digest": "0f37fc6b6b8bfb901f05ee94db9c5978", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1792, "upload_time": "2016-09-16T20:14:20", "url": "https://files.pythonhosted.org/packages/d9/2a/d439982d958cb60c5f4ae6ef10709c195ebfe5e20cb15c383708d46440a2/mock-import-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0f37fc6b6b8bfb901f05ee94db9c5978", "sha256": "a29586f195c872d3fdcf1184230ae248c6432d2b453f7052c6f9a21bf7073d22" }, "downloads": -1, "filename": "mock-import-0.0.3.tar.gz", "has_sig": false, "md5_digest": "0f37fc6b6b8bfb901f05ee94db9c5978", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1792, "upload_time": "2016-09-16T20:14:20", "url": "https://files.pythonhosted.org/packages/d9/2a/d439982d958cb60c5f4ae6ef10709c195ebfe5e20cb15c383708d46440a2/mock-import-0.0.3.tar.gz" } ] }