pytest_defer


Namepytest_defer JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
SummaryA 'defer' fixture for pytest
upload_time2024-11-13 19:39:28
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseMIT License Copyright (c) 2021 Miki Tebeka Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords testing pytest
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pytest_defer - A "defer" fixture for pytest


```python
def test_example(defer):
    # All functions appended to defer will execute at test end in reverse order
    instance1 = spin_instance()
    defer.append(delete_instance, instance1)  # called second
    instance2 = spin_instance()
    defer.append(delete_instance, instance2, timeout=30)  # called first

    # Test code using instance1 & instance2
    ...
```

## Development

Me (@tebeka) is playing around with [uv](https://docs.astral.sh/uv) for this project.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pytest_defer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "testing, pytest",
    "author": null,
    "author_email": "Miki Tebeka <miki@353solutions.com>",
    "download_url": "https://files.pythonhosted.org/packages/5a/f7/bc26befedff3c76fe1c1386139542528050d9b29dc0205e482f94a09b642/pytest_defer-0.2.1.tar.gz",
    "platform": null,
    "description": "# pytest_defer - A \"defer\" fixture for pytest\n\n\n```python\ndef test_example(defer):\n    # All functions appended to defer will execute at test end in reverse order\n    instance1 = spin_instance()\n    defer.append(delete_instance, instance1)  # called second\n    instance2 = spin_instance()\n    defer.append(delete_instance, instance2, timeout=30)  # called first\n\n    # Test code using instance1 & instance2\n    ...\n```\n\n## Development\n\nMe (@tebeka) is playing around with [uv](https://docs.astral.sh/uv) for this project.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2021 Miki Tebeka  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A 'defer' fixture for pytest",
    "version": "0.2.1",
    "project_urls": null,
    "split_keywords": [
        "testing",
        " pytest"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "950be3264820559a8e26e27794d87f683ed0772d002be6572f681124880fdd1a",
                "md5": "1125fad2fb253c4f5fe47403d2b9f28b",
                "sha256": "f34099a20eb96ce8b2f9e13fb958d6faf8babeceb4c5f5e95831dfb09efb0377"
            },
            "downloads": -1,
            "filename": "pytest_defer-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1125fad2fb253c4f5fe47403d2b9f28b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 3245,
            "upload_time": "2024-11-13T19:39:27",
            "upload_time_iso_8601": "2024-11-13T19:39:27.347933Z",
            "url": "https://files.pythonhosted.org/packages/95/0b/e3264820559a8e26e27794d87f683ed0772d002be6572f681124880fdd1a/pytest_defer-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5af7bc26befedff3c76fe1c1386139542528050d9b29dc0205e482f94a09b642",
                "md5": "a2227de6ac3f3dd27619015beccb9c5b",
                "sha256": "929410399b9cdd67081b8fc930cfe3c883315140417098b7b57a8394cde8c1ce"
            },
            "downloads": -1,
            "filename": "pytest_defer-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a2227de6ac3f3dd27619015beccb9c5b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 2916,
            "upload_time": "2024-11-13T19:39:28",
            "upload_time_iso_8601": "2024-11-13T19:39:28.543814Z",
            "url": "https://files.pythonhosted.org/packages/5a/f7/bc26befedff3c76fe1c1386139542528050d9b29dc0205e482f94a09b642/pytest_defer-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-13 19:39:28",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pytest_defer"
}
        
Elapsed time: 0.49327s