{ "info": { "author": "Jimmy Girardet", "author_email": "ijkl@netc.fr", "bugtrack_url": null, "classifiers": [ "Framework :: Pytest", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Testing" ], "description": "==============\npytest-ponyorm\n==============\n\n.. image:: https://img.shields.io/pypi/v/pytest-ponyorm.svg\n :target: https://pypi.python.org/pypi/pytest-ponyorm\n :alt: PyPI version\n\n.. image:: https://img.shields.io/pypi/pyversions/pytest-ponyorm.svg\n :target: https://pypi.python.org/pypi/pytest-ponyorm\n :alt: Python versions\n\n.. image:: https://travis-ci.org/jgirardet/pytest-ponyorm.svg?branch=master\n :target: https://travis-ci.org/jgirardet/pytest-ponyorm\n :alt: See Build Status on Travis CI\n\nPonyORM in Pytest\n\n----\n\nPlugin for use `Pony ORM`_ in `Pytest`_.\n\nThis `Pytest`_ plugin was generated with `Cookiecutter`_ along with `@hackebrot`_'s `Cookiecutter-pytest-plugin`_ template.\n\n\nFeatures\n--------\n\n* Access Database instance (db) via *ponydb* fixture\n* Mark tests to auto allow use of *pony.orm.db_session*\n* Database is by default cleared after each test\n* Database reset can be cancelled for test/class/module\n\n\nRequirements\n------------\n\nTested from `Pony ORM`_ >= '0.7.3' and python : 3.5, 3.6\n\n\nInstallation\n------------\n\nYou can install \"pytest-ponyorm\" via `pip`_ from `PyPI`_::\n\n $ pip install pytest-ponyorm\n or\n $ pipenv install -d pytest-ponyorm\n\n\nUsage\n-----\n\n.. warning:: By default, database is cleared after each test. You must never use it in a production environment. This plugin doesn't change the database config.It's you'job to create the testing environment and change database params.\n\nFirst, configure PONY_DB in pytest.ini. PonyORM main Database instance module location must be specified in pytest.ini to make it work : for example if db is in /path/models/main.py, you must configure like this :\n\n.. code-block:: ini\n\n [pytest]\n\tPONY_DB=path.models.main\n\nThen just apply the pony marker :\n\n.. code-block:: python\n\n # models.py\n\n db = Database()\n\n # test.py\n\n @pytest.mark.pony\n def my_test(ponydb):\n new_mod = ponydb.Mymodel(name=\"me\",...)\n\nYou can mark a class or function with @pytest.mark.pony or the whole module with pytestmark = pytest.mark.pony\n\nThe marker *pony* takes one argument : *reset_db*, default is True. In this case the marked test doesn't reset the database at ending.\n\n.. code-block:: python\n\n\t# test.py\n pytestmark = pytest.mark.pony # marks all tests of the module\n\n def test1:\n \tpass\n\n def test2:\n \tpass\n\n @pytest.mark.pony(reset_db=False)\n def test 3:\n \tpass\n\n # test3 will use database in the state that test2 left it.\n\nAbout Reseting Database:\n-------------------------\nTest database tables are dropped/recreate before the test SESSION.\n\nInitialy this plugin did drop/recreate table for each test. Due to perfomance reason, this has changed. Now tables are cleared but not dropped. \n\n\nSql sequences like \"auto PrimaryKey\" will also be reset but actually, it's only supported for PostgreSQL and Sqlite. For other databases, Primarykey might not start at 1 for each test. This has to be considered when writing tests.\n\n\n\nAbout Fixtures :\n-----------------\nFixtures should not use db_session decorator or context manager. Each test is automaticaly run inside a db_session and each operation inside fixtures will be commited at test start.\n\n\nContributing\n------------\nContributions are very welcome. Tests can be run with `tox`_, please ensure\nthe coverage at least stays the same before you submit a pull request.\n\n\nLicense\n-------\n\nDistributed under the terms of the `GNU GPL v3.0`_ license, \"pytest-ponyorm\" is free and open source software\n\n\nIssues\n------\n\nIf you encounter any problems, please `file an issue`_ along with a detailed description.\n\n\nChangelog\n----------\n0.3.1 :\n - sql sequence reset for postgre and sqlite\n - testing py35/36 and pg/sqlite\n0.3.0 : \n - made faster with just deleting database entries after each test\n - no drop/recreate\n - db_session splitted into 2 hooks, not anymore in a fixture\n0.2.9 :\n - add fixture autocommit before run test\n0.2.0 :\n - add marker\n0.1.5 :\n - add db_session for each test\n0.1.0 :\n - auto clear database\n\n\n.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter\n.. _`@hackebrot`: https://github.com/hackebrot\n.. _`MIT`: http://opensource.org/licenses/MIT\n.. _`BSD-3`: http://opensource.org/licenses/BSD-3-Clause\n.. _`GNU GPL v3.0`: http://www.gnu.org/licenses/gpl-3.0.txt\n.. _`Apache Software License 2.0`: http://www.apache.org/licenses/LICENSE-2.0\n.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin\n.. _`file an issue`: https://github.com/jgirardet/pytest-ponyorm/issues\n.. _`pytest`: https://github.com/pytest-dev/pytest\n.. _`tox`: https://tox.readthedocs.io/en/latest/\n.. _`pip`: https://pypi.python.org/pypi/pip/\n.. _`PyPI`: https://pypi.python.org/pypi\n.. _`Pony ORM`: http://ponyorm.com\n.. _`pytest-env`: https://github.com/MobileDynasty/pytest-env\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jgirardet/pytest-ponyorm", "keywords": "", "license": "GNU GPL v3.0", "maintainer": "Jimmy Girardet", "maintainer_email": "ijkl@netc.fr", "name": "pytest-ponyorm", "package_url": "https://pypi.org/project/pytest-ponyorm/", "platform": "", "project_url": "https://pypi.org/project/pytest-ponyorm/", "project_urls": { "Homepage": "https://github.com/jgirardet/pytest-ponyorm" }, "release_url": "https://pypi.org/project/pytest-ponyorm/0.3.3/", "requires_dist": [ "pytest (>=3.1.1)" ], "requires_python": ">=3.5", "summary": "PonyORM in Pytest", "version": "0.3.3" }, "last_serial": 4437700, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "60eaf5b409efb81e7d9bf125e4eb29cf", "sha256": "5eed360e2f83415c25a378b8b0aba58c57249774a52aaff9246634e1d49edc7c" }, "downloads": -1, "filename": "pytest_ponyorm-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "60eaf5b409efb81e7d9bf125e4eb29cf", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 6329, "upload_time": "2018-03-19T22:40:07", "url": "https://files.pythonhosted.org/packages/d0/42/46df2567aeb700ded03733dcd5cea548ed0f62a61282c040f41e57340d5a/pytest_ponyorm-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c5296ecf0a353b202eaaafafa95dd744", "sha256": "5238f1c73f36509d61022264f728590852ef6da2d072fc5983dd45ec8aa48e58" }, "downloads": -1, "filename": "pytest_ponyorm-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c5296ecf0a353b202eaaafafa95dd744", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 6331, "upload_time": "2018-03-19T22:39:05", "url": "https://files.pythonhosted.org/packages/a6/f4/53cf54f6aa003aa6455cda71c03c32dfd43824590b35f803b87f239675b4/pytest_ponyorm-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8f0200432a0a487824fac5e9154fd678", "sha256": "2cd9a1587ec002129b6b47a651da5bd73cb2e8fd6759289e2221728c3df38ae5" }, "downloads": -1, "filename": "pytest-ponyorm-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8f0200432a0a487824fac5e9154fd678", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 17736, "upload_time": "2018-03-19T22:39:06", "url": "https://files.pythonhosted.org/packages/16/6c/fb3fc52e6265dccd845260c06b6594e2c162fee8c25e3f281d6771633ce4/pytest-ponyorm-0.1.0.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "c6d59a019b992371a23f54b6d32633ff", "sha256": "aa28d622e34602c3a9616dfd8cc9e0e5c582346632ecc531071b78e8d72f36a8" }, "downloads": -1, "filename": "pytest_ponyorm-0.2.3-py2-none-any.whl", "has_sig": false, "md5_digest": "c6d59a019b992371a23f54b6d32633ff", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 6334, "upload_time": "2018-03-19T23:27:01", "url": "https://files.pythonhosted.org/packages/68/a3/f993e59a0b725e99830c2debf8a92a0f7c0bc156eca4a86e55e3ea4113f7/pytest_ponyorm-0.2.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f2347895fdcc94229b32bcfd8c8ab59c", "sha256": "a320008a88d6c9dc0ffbea17ec843eb4cf789da5496f6be089a42deba08d3f7e" }, "downloads": -1, "filename": "pytest_ponyorm-0.2.3-py3-none-any.whl", "has_sig": false, "md5_digest": "f2347895fdcc94229b32bcfd8c8ab59c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 6333, "upload_time": "2018-03-19T23:26:25", "url": "https://files.pythonhosted.org/packages/76/b0/ec7233ee83dd8312e36e47cf188fb5ebcbab36124d4bd0f29c02e4674679/pytest_ponyorm-0.2.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "04e8d668ee06a7758294bf5afdc270c0", "sha256": "5de203f03f92505ffaa52ec62a0a77203804090865bee8a25e2a4880021782d2" }, "downloads": -1, "filename": "pytest-ponyorm-0.2.3.tar.gz", "has_sig": false, "md5_digest": "04e8d668ee06a7758294bf5afdc270c0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 17735, "upload_time": "2018-03-19T23:26:27", "url": "https://files.pythonhosted.org/packages/9f/7f/4505c292d2bc362c7b3ce2ac9c91310905bfea1e2d678ed7cb4ed187ffd4/pytest-ponyorm-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "bcbc30656b17fff1410004dbd5140adc", "sha256": "242eefedbfaefcea8d690272fcbe44b2e5efe39336015e17b111726ab6489c51" }, "downloads": -1, "filename": "pytest_ponyorm-0.2.4-py2-none-any.whl", "has_sig": false, "md5_digest": "bcbc30656b17fff1410004dbd5140adc", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 6333, "upload_time": "2018-03-20T08:02:29", "url": "https://files.pythonhosted.org/packages/5c/be/976c4587b7670cc45d89493f258caa346634cd2f45abff3664c514cbeba4/pytest_ponyorm-0.2.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "340ec61038b3e6916eef5bce174c5f34", "sha256": "2044e7d5a301e69694e41d2cad77b37339e9c9dd8025bfca985cbeb5149bde62" }, "downloads": -1, "filename": "pytest_ponyorm-0.2.4-py3-none-any.whl", "has_sig": false, "md5_digest": "340ec61038b3e6916eef5bce174c5f34", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 6331, "upload_time": "2018-03-20T08:02:02", "url": "https://files.pythonhosted.org/packages/a3/b8/2e34ebe117aa1557ee77207b5b27cb1ed78eccfae97b1425aec54a54b8dd/pytest_ponyorm-0.2.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b7a728ba577bfdd45a721b1ab77f2145", "sha256": "3ee5b325fdaf3bbbeccf18c9892a5b6e606ae06edc608466ead69f059c768c8b" }, "downloads": -1, "filename": "pytest-ponyorm-0.2.4.tar.gz", "has_sig": false, "md5_digest": "b7a728ba577bfdd45a721b1ab77f2145", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 17741, "upload_time": "2018-03-20T08:02:04", "url": "https://files.pythonhosted.org/packages/c3/a7/79b50c6691c6d178e530311fe0e4356b2ded33843d4e2b58da4620a3b9fa/pytest-ponyorm-0.2.4.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "368778e3d8e1fa774584c97a7a5bdc11", "sha256": "d0cc8f725a93b29c5e1e60e526cb929fd2f296928dfc5bf9f2a3c0df0889f333" }, "downloads": -1, "filename": "pytest_ponyorm-0.2.8-py3-none-any.whl", "has_sig": false, "md5_digest": "368778e3d8e1fa774584c97a7a5bdc11", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6282, "upload_time": "2018-03-27T20:35:15", "url": "https://files.pythonhosted.org/packages/1b/d9/8db3d3bc06d7b8cbda06593a4ff6b78f3444ba6130923f464e7abcdedae1/pytest_ponyorm-0.2.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5bc2477a6e322e6ad114c0f91d528f16", "sha256": "43debf43cf56829a1f9b4dd4b33355172d4ef584b2c064a5975d588d40fd2bf1" }, "downloads": -1, "filename": "pytest-ponyorm-0.2.8.tar.gz", "has_sig": false, "md5_digest": "5bc2477a6e322e6ad114c0f91d528f16", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 17675, "upload_time": "2018-03-27T20:35:16", "url": "https://files.pythonhosted.org/packages/b2/08/736600ce91c0ef0bc81706f45bbf1c361e14792cb0d96d1608c146365fc2/pytest-ponyorm-0.2.8.tar.gz" } ], "0.2.9": [ { "comment_text": "", "digests": { "md5": "eeb02adec414832fea28204bd76bb362", "sha256": "8ada876a42e939ec8c7f1a0dfc8fbf2b935797c65ca2f949f1f8fa35d4cf1db2" }, "downloads": -1, "filename": "pytest-ponyorm-0.2.9.tar.gz", "has_sig": false, "md5_digest": "eeb02adec414832fea28204bd76bb362", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 17905, "upload_time": "2018-04-01T21:09:58", "url": "https://files.pythonhosted.org/packages/e8/59/5c32e5451d609685ada44a6192ceb9483c9b6de4a1fc2eefb5d735ef3445/pytest-ponyorm-0.2.9.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "f9896de572c8d6a84ebb8c00aa25a438", "sha256": "ac6859539d65ed9085940b0f88533711e2d7540c8afcf2af2ac0d561da187a69" }, "downloads": -1, "filename": "pytest_ponyorm-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f9896de572c8d6a84ebb8c00aa25a438", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 4372, "upload_time": "2018-04-02T21:41:04", "url": "https://files.pythonhosted.org/packages/33/1a/0a172b3346316a4b4beacff2b5d65179bd71bdd2e38e080e6c40dc837764/pytest_ponyorm-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4e08539e9576aa1cb9b1ffaa6ca827f8", "sha256": "e22ac6ab8182f845181bc7c5a6443090303bc438dd2a3f5201e5d704d2e6b3d0" }, "downloads": -1, "filename": "pytest-ponyorm-0.3.0.tar.gz", "has_sig": false, "md5_digest": "4e08539e9576aa1cb9b1ffaa6ca827f8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 18721, "upload_time": "2018-04-02T21:41:06", "url": "https://files.pythonhosted.org/packages/53/3c/5768e1c9c5d7653818705780a2496aea58bb18dffb21f3b3b8914152a6b2/pytest-ponyorm-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "b3784112f76a8109168624583a69a8c1", "sha256": "d89c8d7fc79ed485e30d8b24dacfb9f567fde8b9d979bfa16000e326ce839411" }, "downloads": -1, "filename": "pytest_ponyorm-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b3784112f76a8109168624583a69a8c1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 4647, "upload_time": "2018-04-04T14:11:37", "url": "https://files.pythonhosted.org/packages/de/6c/a4a19120ac93ffd0109ad6265c52ad0a84a53580de6faa71cd3ece41c075/pytest_ponyorm-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "706ed4965530c4bef62a28967d143cee", "sha256": "37a6ecb69b6f8bf7c231500f53c91e35a477cc4aad1f0eef9c2b794001762415" }, "downloads": -1, "filename": "pytest-ponyorm-0.3.1.tar.gz", "has_sig": false, "md5_digest": "706ed4965530c4bef62a28967d143cee", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 18562, "upload_time": "2018-04-04T14:11:38", "url": "https://files.pythonhosted.org/packages/ec/39/d7a8c11243e9381bc98fa06c39c6e97c20fcc4db4f48e58a7b7597259931/pytest-ponyorm-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "a4c7ab09cf9b65c144048e705b6e1850", "sha256": "a94507ad2944081da4785ba2c806ae39d7f58fee70c99f1eac592511f931c9f5" }, "downloads": -1, "filename": "pytest_ponyorm-0.3.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a4c7ab09cf9b65c144048e705b6e1850", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 4653, "upload_time": "2018-05-08T21:42:46", "url": "https://files.pythonhosted.org/packages/bb/94/d8fe7ca6cddbc4d2adc6a218045011b4da06ff6f64263977cb7ed7ae51cd/pytest_ponyorm-0.3.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6dba9128305e96998d2c1a58192d9537", "sha256": "952dc4f899d3b627115fbacad2314cefb2e4173e88d065d431c192cb9568d11f" }, "downloads": -1, "filename": "pytest-ponyorm-0.3.2.tar.gz", "has_sig": false, "md5_digest": "6dba9128305e96998d2c1a58192d9537", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 19112, "upload_time": "2018-05-08T21:42:48", "url": "https://files.pythonhosted.org/packages/b8/81/2ff59aa4a42205fa955abacdf51ccdb911d63383ce3086030132b388101b/pytest-ponyorm-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "348b020bd3594f233a6f049765aa4e68", "sha256": "e387ce9572b64a63c9aa2b74391c24a21ef75e855c1b390fb5e7d862df0b25fb" }, "downloads": -1, "filename": "pytest_ponyorm-0.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "348b020bd3594f233a6f049765aa4e68", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 4658, "upload_time": "2018-10-31T17:24:41", "url": "https://files.pythonhosted.org/packages/b8/d1/10de94c4363d2f13957e6f5659cef9294add8215cf401118fed771693347/pytest_ponyorm-0.3.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "00715c48f9c55d27cda5461c428107ea", "sha256": "8c17bf7cdb339d55bbe83d03e173bcf68d619b539bd957d12968834ca7e8b75b" }, "downloads": -1, "filename": "pytest-ponyorm-0.3.3.tar.gz", "has_sig": false, "md5_digest": "00715c48f9c55d27cda5461c428107ea", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 17095, "upload_time": "2018-10-31T17:24:42", "url": "https://files.pythonhosted.org/packages/2c/3e/74746d08ef121a88808159acbb6af00e3af0023efac81acc23ae49d6569b/pytest-ponyorm-0.3.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "348b020bd3594f233a6f049765aa4e68", "sha256": "e387ce9572b64a63c9aa2b74391c24a21ef75e855c1b390fb5e7d862df0b25fb" }, "downloads": -1, "filename": "pytest_ponyorm-0.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "348b020bd3594f233a6f049765aa4e68", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 4658, "upload_time": "2018-10-31T17:24:41", "url": "https://files.pythonhosted.org/packages/b8/d1/10de94c4363d2f13957e6f5659cef9294add8215cf401118fed771693347/pytest_ponyorm-0.3.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "00715c48f9c55d27cda5461c428107ea", "sha256": "8c17bf7cdb339d55bbe83d03e173bcf68d619b539bd957d12968834ca7e8b75b" }, "downloads": -1, "filename": "pytest-ponyorm-0.3.3.tar.gz", "has_sig": false, "md5_digest": "00715c48f9c55d27cda5461c428107ea", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 17095, "upload_time": "2018-10-31T17:24:42", "url": "https://files.pythonhosted.org/packages/2c/3e/74746d08ef121a88808159acbb6af00e3af0023efac81acc23ae49d6569b/pytest-ponyorm-0.3.3.tar.gz" } ] }