{ "info": { "author": "Ruben Quinones", "author_email": "ruben.quinones.gomez@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Database", "Topic :: Software Development :: Libraries" ], "description": "What is this?\n=============\n\nThis is a pytest plugin based on pytest-mongodb_ and mongomock_ that enables you\nto test your code that relies on a callback- or Future-based API for non-blocking access\nto a MongoDB and expects certain data to be present.\nIt allows you to specify fixtures for database collections in JSON/BSON or YAML\nformat. Under the hood we use the mongomock library, that you should\nconsult for documentation on how to use MongoDB mock objects. If suitable you\ncan also use a real MongoDB server.\n\n\nConfiguration\n-------------\n\nIf you don't want to put your database fixtures on the top-level directory of your package\nyou have to specify a directory where ``pytest-async-mongodb`` looks for your data definitions.\n\nTo do so put a line like the following under the ``pytest`` section of your\n``pytest.ini``-file put a\n\n.. code-block:: ini\n\n [pytest]\n async_mongodb_fixture_dir =\n tests/unit/fixtures\n\n async_mongodb_fixtures =\n fixture_1\n fixture_2\n\n``pytest-async-mongodb`` would then look for files ending in ``.yaml`` or ``.json`` in that\ndirectory.\n\nUnlike pytest-mongodb, you cannot specify a real MongoDB connection with the pymongo client.\n\n\nBasic usage\n-----------\n\nAfter you configured ``pytest-async-mongodb`` so that it can find your fixtures you're ready to\nspecify some data. Regardless of the markup language you choose, the data is provided\nas a list of documents (dicts). The collection that these documents are being inserted\ninto is given by the filename of your fixture-file. E.g.: If you had a file named\n``players.yaml`` with the following content:\n\n.. code-block:: yaml\n\n -\n name: Mario\n surname: G\u00f6tze\n position: striker\n\n -\n name: Manuel\n surname: Neuer\n position: keeper\n\n\nyou'd end up with a collection ``players`` that has the above player definitions\ninserted. If your fixture file is in JSON/BSON format you can also use BSON specific\ntypes like ``$oid``, ``$date``, etc.\n\n\nYou get ahold of the database in your test-function by using the ``async_mongodb`` fixture\nlike so:\n\n.. code-block:: python\n\n @pytest.mark.asyncio\n async def test_players(async_mongodb):\n manuel = await async_mongodb.players.find_one({'name': 'Manuel'})\n assert manuel['surname'] == 'Neuer'\n\n\nFor further information refer to the mongomock_ documentation.\n\n.. _mongomock: https://github.com/vmalloc/mongomock\n.. _pytest: https://docs.pytest.org/en/latest/\n.. _pytest-mongodb: https://github.com/mdomke/pytest-mongodb/\n\n\n\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/xzased/pytest-async-mongodb", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pytest-async-mongodb", "package_url": "https://pypi.org/project/pytest-async-mongodb/", "platform": "", "project_url": "https://pypi.org/project/pytest-async-mongodb/", "project_urls": { "Homepage": "https://github.com/xzased/pytest-async-mongodb" }, "release_url": "https://pypi.org/project/pytest-async-mongodb/0.0.1.dev3/", "requires_dist": [ "mongomock", "pyyaml", "pytest-asyncio", "pytest (>=2.5.2)" ], "requires_python": "", "summary": "pytest plugin for async MongoDB", "version": "0.0.1.dev3" }, "last_serial": 3260042, "releases": { "0.0.1.dev3": [ { "comment_text": "", "digests": { "md5": "1fc67e7b6e477ca425cfd490ec8f787c", "sha256": "c925d75620d4cf190f9c9efe75ed4f9b83a1ed536bebfaab9ded2e5f9123cfdf" }, "downloads": -1, "filename": "pytest_async_mongodb-0.0.1.dev3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1fc67e7b6e477ca425cfd490ec8f787c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7075, "upload_time": "2017-10-18T14:22:55", "url": "https://files.pythonhosted.org/packages/b3/4b/239e79c6813372fc58f85d0106a2f1937f2b411a68814e3ea81dc6696f15/pytest_async_mongodb-0.0.1.dev3-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1fc67e7b6e477ca425cfd490ec8f787c", "sha256": "c925d75620d4cf190f9c9efe75ed4f9b83a1ed536bebfaab9ded2e5f9123cfdf" }, "downloads": -1, "filename": "pytest_async_mongodb-0.0.1.dev3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1fc67e7b6e477ca425cfd490ec8f787c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7075, "upload_time": "2017-10-18T14:22:55", "url": "https://files.pythonhosted.org/packages/b3/4b/239e79c6813372fc58f85d0106a2f1937f2b411a68814e3ea81dc6696f15/pytest_async_mongodb-0.0.1.dev3-py2.py3-none-any.whl" } ] }