pytest-common-subject


Namepytest-common-subject JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/theY4Kman/pytest-common-subject
Summarypytest framework for testing different aspects of a common method
upload_time2024-06-03 07:04:44
maintainerNone
docs_urlNone
authorZach "theY4Kman" Kanzler
requires_python<4.0,>=3.8
licenseMIT
keywords pytest
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pytest-common-subject
[![pytest-common-subject PyPI version](https://badge.fury.io/py/pytest-common-subject.svg)](https://pypi.python.org/pypi/pytest-common-subject/)
[![pytest-common-subject PyPI pyversions](https://img.shields.io/pypi/pyversions/pytest-common-subject.svg)](https://pypi.python.org/pypi/pytest-common-subject/)
[![pytest-common-subject PyPI license](https://img.shields.io/pypi/l/pytest-common-subject.svg)](https://pypi.python.org/pypi/pytest-common-subject/)

**pytest-common-subject** is a "framework" for organizing tests to reduce boilerplate while writing, improve skimmability when reading, and bolster parallelization when executing the suite.

To utilize this framework, we first choose a single function that our group of tests will all call — in other words, an entry point, or a _common subject_. This function will be automatically called before each of our tests, with args and kwargs that can be customized by overriding fixtures — enabling child test classes to make HTTP requests as a different user, or to use a different cache backend, or to change the value of a monkeypatched method.

The return value of the chosen function will be passed as a fixture to each test. To reap the full benefits of the framework, create separate tests to verify different aspects of the return value. Was the response status code a 200? Did the response contain the expected data? Were the expected rows created in the database? By using separate tests for each of these aspects, we can pinpoint and correct multiple bugs at once, instead of getting sucked into a fix-test-fix cycle with its chorus of "oh, bother, not again!"

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/theY4Kman/pytest-common-subject",
    "name": "pytest-common-subject",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "pytest",
    "author": "Zach \"theY4Kman\" Kanzler",
    "author_email": "they4kman@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/41/00/81e2ea2ac7cd23bc2b96119419026813c13221e3470b48452d78b9871438/pytest_common_subject-1.1.0.tar.gz",
    "platform": null,
    "description": "# pytest-common-subject\n[![pytest-common-subject PyPI version](https://badge.fury.io/py/pytest-common-subject.svg)](https://pypi.python.org/pypi/pytest-common-subject/)\n[![pytest-common-subject PyPI pyversions](https://img.shields.io/pypi/pyversions/pytest-common-subject.svg)](https://pypi.python.org/pypi/pytest-common-subject/)\n[![pytest-common-subject PyPI license](https://img.shields.io/pypi/l/pytest-common-subject.svg)](https://pypi.python.org/pypi/pytest-common-subject/)\n\n**pytest-common-subject** is a \"framework\" for organizing tests to reduce boilerplate while writing, improve skimmability when reading, and bolster parallelization when executing the suite.\n\nTo utilize this framework, we first choose a single function that our group of tests will all call \u2014 in other words, an entry point, or a _common subject_. This function will be automatically called before each of our tests, with args and kwargs that can be customized by overriding fixtures \u2014 enabling child test classes to make HTTP requests as a different user, or to use a different cache backend, or to change the value of a monkeypatched method.\n\nThe return value of the chosen function will be passed as a fixture to each test. To reap the full benefits of the framework, create separate tests to verify different aspects of the return value. Was the response status code a 200? Did the response contain the expected data? Were the expected rows created in the database? By using separate tests for each of these aspects, we can pinpoint and correct multiple bugs at once, instead of getting sucked into a fix-test-fix cycle with its chorus of \"oh, bother, not again!\"\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "pytest framework for testing different aspects of a common method",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/theY4Kman/pytest-common-subject",
        "Repository": "https://github.com/theY4Kman/pytest-common-subject"
    },
    "split_keywords": [
        "pytest"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4a7f922b1f9f17c28169fbbacbc3e99e7672aaf70d862ae4f671cf91d77d7d40",
                "md5": "8eb951e7e854821e9f85d82df9a7e5a6",
                "sha256": "fe952950a127382a183293c1798cfea0f78afb312c06273a92581d7ba4c8a64a"
            },
            "downloads": -1,
            "filename": "pytest_common_subject-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8eb951e7e854821e9f85d82df9a7e5a6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 8048,
            "upload_time": "2024-06-03T07:04:43",
            "upload_time_iso_8601": "2024-06-03T07:04:43.109102Z",
            "url": "https://files.pythonhosted.org/packages/4a/7f/922b1f9f17c28169fbbacbc3e99e7672aaf70d862ae4f671cf91d77d7d40/pytest_common_subject-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "410081e2ea2ac7cd23bc2b96119419026813c13221e3470b48452d78b9871438",
                "md5": "0962f62bf9ff2ee7ad106a4824483408",
                "sha256": "1b7c4d92eeabd842d5a339b16c7325c8bc8eb19e709fcbbdb0d0f10565a0cc26"
            },
            "downloads": -1,
            "filename": "pytest_common_subject-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0962f62bf9ff2ee7ad106a4824483408",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 9074,
            "upload_time": "2024-06-03T07:04:44",
            "upload_time_iso_8601": "2024-06-03T07:04:44.644274Z",
            "url": "https://files.pythonhosted.org/packages/41/00/81e2ea2ac7cd23bc2b96119419026813c13221e3470b48452d78b9871438/pytest_common_subject-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-03 07:04:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "theY4Kman",
    "github_project": "pytest-common-subject",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "pytest-common-subject"
}
        
Elapsed time: 0.24553s