{ "info": { "author": "Samuel Colvin", "author_email": "S@muelColvin.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Framework :: Pytest", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Testing" ], "description": "pytest-toolbox\n==============\n\n|Build Status| |codecov.io| |PyPI Status| |license|\n\nCopyright (C) 2016 Samuel Colvin\n\nNumerous useful plugins for pytest.\n\nFixtures\n--------\n\n``tmpworkdir``\n Run the test with the working directory set to a temporary directory. Similar to the pytest plugin ``tmpdir``\n except working directory is changed.\n\n``smart_caplog``\n capture logs with a smarter interface than pytest's native ``caplog``\n\n``print_logs``\n print all logs.\n\n``loop``\n asyncio loop.\n\nMethods\n-------\n\n(See below for usage examples).\n\n``mktree``\n Create a tree of files from a dictionary.\n\n``gettree``\n Return a dictionary depicting a directory tree.\n\n\nComparison Objects\n------------------\n\nAll can be imported from ``pytest_toolbox.comparison``.\n\n``CloseToNow``\n check that a date (or date-like object) is close to now\n\n``AnyInt``\n check tests that an object is an int\n\n``RegexStr``\n check that a string matches the regex\n\n``IsUUID``\n that that an object is an instance of ``UUID``.\n\nUsed with equals as in ``my_date == CloseToNow()``, these are useful when checking objects which contain\na few unknown values are as expected\n\nEg.\n\n.. code-block:: python\n\n assert {\n 'details': {\n 'user': 'foobar@example.com',\n 'id': AnyInt(),\n 'published': False,\n 'event': 'an example',\n 'created_ts': CloseToNow(),\n },\n 'other_thing': [\n ...\n ],\n ...\n } == obj\n\nUsage\n-----\n\n.. code:: python\n\n from pytest_toolbox import gettree, mktree\n\n def test_whatever(tmpworkdir):\n mktree(tmpworkdir, {\n 'foobar.txt': 'has this content'\n })\n assert gettree(tmpworkdir) = {'foobar.txt': 'has this content'}\n\n**TODO**\n\n\n.. |Build Status| image:: https://travis-ci.org/samuelcolvin/pytest-toolbox.svg?branch=master\n :target: https://travis-ci.org/samuelcolvin/pytest-toolbox\n.. |codecov.io| image:: http://codecov.io/github/samuelcolvin/pytest-toolbox/coverage.svg?branch=master\n :target: http://codecov.io/github/samuelcolvin/pytest-toolbox?branch=master\n.. |PyPI Status| image:: https://img.shields.io/pypi/v/pytest-toolbox.svg?style=flat\n :target: https://pypi.python.org/pypi/pytest-toolbox\n.. |license| image:: https://img.shields.io/pypi/l/pytest-toolbox.svg\n :target: https://github.com/samuelcolvin/pytest-toolbox\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/samuelcolvin/pytest-toolbox", "keywords": "pytest,plugin,toolbox", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pytest-toolbox", "package_url": "https://pypi.org/project/pytest-toolbox/", "platform": "any", "project_url": "https://pypi.org/project/pytest-toolbox/", "project_urls": { "Homepage": "https://github.com/samuelcolvin/pytest-toolbox" }, "release_url": "https://pypi.org/project/pytest-toolbox/0.4/", "requires_dist": [ "pytest (>=3.5.0)" ], "requires_python": ">=3.5", "summary": "Numerous useful plugins for pytest.", "version": "0.4" }, "last_serial": 3743713, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ff33ab91b6841ff66b9b80b366849642", "sha256": "d418e42f7f66834a710076ea7b9273334ffa2d5110f15ffe1065480b8e336c6c" }, "downloads": -1, "filename": "pytest_toolbox-0.1-py35-none-any.whl", "has_sig": false, "md5_digest": "ff33ab91b6841ff66b9b80b366849642", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 6374, "upload_time": "2016-12-06T19:33:57", "url": "https://files.pythonhosted.org/packages/38/96/d4419bb034333908c88ef5b82ce5dbb2b6a92827edb4011d8356d2b5e82a/pytest_toolbox-0.1-py35-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f904ad99fd14b17dd95b4f72b4fbe42b", "sha256": "80544fd920ecac187d604a35133ee0ae95f8caa63ceb976fbf4b18bf26006b55" }, "downloads": -1, "filename": "pytest-toolbox-0.1.tar.gz", "has_sig": false, "md5_digest": "f904ad99fd14b17dd95b4f72b4fbe42b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4260, "upload_time": "2016-12-06T19:33:56", "url": "https://files.pythonhosted.org/packages/dc/a6/3b639e002e6c54964468fbc074e8bc2a540cf22c41fbfdc5d5649260e507/pytest-toolbox-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "8ab42499f1909dfaff12e060bed999ae", "sha256": "115dd91443ef17fa430617932b7e8f04d10b9d42d2b81f8d2a8730e72da1e222" }, "downloads": -1, "filename": "pytest_toolbox-0.2-py35-none-any.whl", "has_sig": false, "md5_digest": "8ab42499f1909dfaff12e060bed999ae", "packagetype": "bdist_wheel", "python_version": "py35", "requires_python": null, "size": 6409, "upload_time": "2017-02-11T16:02:30", "url": "https://files.pythonhosted.org/packages/23/46/2d073eb23b2c80c2471d09122f7533bf9be5347efbea4981337ffd20d3df/pytest_toolbox-0.2-py35-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9a492a4eb1a3894b6eddc25ec8f2bf27", "sha256": "a799869c6657b60b90a029910c77b5c9c46d3d8a0705efe06d1f57c3de3da28d" }, "downloads": -1, "filename": "pytest-toolbox-0.2.tar.gz", "has_sig": false, "md5_digest": "9a492a4eb1a3894b6eddc25ec8f2bf27", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4220, "upload_time": "2017-02-11T16:02:31", "url": "https://files.pythonhosted.org/packages/98/4d/e3509dd475cffa2b045b812f73d95d5a48ae4a45270e7dc6165b83ea0db4/pytest-toolbox-0.2.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "81f3142d390f27153bae3bdebf573b27", "sha256": "31db0ee5492e0878ece2a98687209cbd96952317c7e1b2a2423342db4a2db103" }, "downloads": -1, "filename": "pytest_toolbox-0.4-py35+-none-any.whl", "has_sig": false, "md5_digest": "81f3142d390f27153bae3bdebf573b27", "packagetype": "bdist_wheel", "python_version": "py35+", "requires_python": ">=3.5", "size": 6234, "upload_time": "2018-04-07T13:53:23", "url": "https://files.pythonhosted.org/packages/c7/01/1d183f6d5c9156da1a82e9d61f93eb8ecb3a7e388b0747e5db4d71e5109e/pytest_toolbox-0.4-py35+-none-any.whl" }, { "comment_text": "", "digests": { "md5": "524107c82087f613ac8af7134dc14792", "sha256": "e23243aabd20dfb4e6ca7c1b18bcda3951119c7827898a535ef84d3e2915a673" }, "downloads": -1, "filename": "pytest-toolbox-0.4.tar.gz", "has_sig": false, "md5_digest": "524107c82087f613ac8af7134dc14792", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 5459, "upload_time": "2018-04-07T13:53:24", "url": "https://files.pythonhosted.org/packages/75/63/ffc87832881f6d0c5899140a4e3d379f5f464f6185ac48c21a2f48662c11/pytest-toolbox-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "81f3142d390f27153bae3bdebf573b27", "sha256": "31db0ee5492e0878ece2a98687209cbd96952317c7e1b2a2423342db4a2db103" }, "downloads": -1, "filename": "pytest_toolbox-0.4-py35+-none-any.whl", "has_sig": false, "md5_digest": "81f3142d390f27153bae3bdebf573b27", "packagetype": "bdist_wheel", "python_version": "py35+", "requires_python": ">=3.5", "size": 6234, "upload_time": "2018-04-07T13:53:23", "url": "https://files.pythonhosted.org/packages/c7/01/1d183f6d5c9156da1a82e9d61f93eb8ecb3a7e388b0747e5db4d71e5109e/pytest_toolbox-0.4-py35+-none-any.whl" }, { "comment_text": "", "digests": { "md5": "524107c82087f613ac8af7134dc14792", "sha256": "e23243aabd20dfb4e6ca7c1b18bcda3951119c7827898a535ef84d3e2915a673" }, "downloads": -1, "filename": "pytest-toolbox-0.4.tar.gz", "has_sig": false, "md5_digest": "524107c82087f613ac8af7134dc14792", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 5459, "upload_time": "2018-04-07T13:53:24", "url": "https://files.pythonhosted.org/packages/75/63/ffc87832881f6d0c5899140a4e3d379f5f464f6185ac48c21a2f48662c11/pytest-toolbox-0.4.tar.gz" } ] }