pyariable


Namepyariable JSON
Version 0.7.0 PyPI version JSON
download
home_pagehttps://github.com/willemt/pyariable
SummaryPlaceholder variables to aid in testing.
upload_time2024-12-04 02:25:46
maintainerNone
docs_urlNone
authorWillem Thiart
requires_python<4.0,>=3.9
licenseBSD-3-Clause
keywords testing development
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            pyariable
#########

Simplify your test assertions forever.

.. code-block:: python
   :class: ignore

   from pyariable import Variable

   def test_dict():
       x = Variable()
       y = Variable()
       assert {1: "XXX", 2: "XXX", 3: "YYY"} == {1: x, 2: x, 3: y}
       assert x != y

In some tests it's common to get a random ID back from a database. Your assertions are simpler when you substitute a `Variable` object for the expected value.

.. code-block:: python
   :class: ignore

   from pyariable import Variable

   def test_list():
       x = Variable()
       y = Variable()
       assert [
           {"db_id": 590, "name": "alice"},
           {"db_id": 590, "name": "bob"},
           {"db_id": 999, "name": "charlie"},
       ] == [
           {"db_id": x, "name": "alice"},
           {"db_id": x, "name": "bob"},
           {"db_id": y, "name": "charlie"},
       ]
       assert x != y
       assert x < y


Installation
------------
.. code-block:: bash
   :class: ignore

   pip install pyariable

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/willemt/pyariable",
    "name": "pyariable",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "testing, development",
    "author": "Willem Thiart",
    "author_email": "himself@willemthiart.com",
    "download_url": "https://files.pythonhosted.org/packages/62/a2/c395618c9110a4b61e3f1db9ba69a4f274237f29fbd7683d00f3ee6e4ca9/pyariable-0.7.0.tar.gz",
    "platform": null,
    "description": "pyariable\n#########\n\nSimplify your test assertions forever.\n\n.. code-block:: python\n   :class: ignore\n\n   from pyariable import Variable\n\n   def test_dict():\n       x = Variable()\n       y = Variable()\n       assert {1: \"XXX\", 2: \"XXX\", 3: \"YYY\"} == {1: x, 2: x, 3: y}\n       assert x != y\n\nIn some tests it's common to get a random ID back from a database. Your assertions are simpler when you substitute a `Variable` object for the expected value.\n\n.. code-block:: python\n   :class: ignore\n\n   from pyariable import Variable\n\n   def test_list():\n       x = Variable()\n       y = Variable()\n       assert [\n           {\"db_id\": 590, \"name\": \"alice\"},\n           {\"db_id\": 590, \"name\": \"bob\"},\n           {\"db_id\": 999, \"name\": \"charlie\"},\n       ] == [\n           {\"db_id\": x, \"name\": \"alice\"},\n           {\"db_id\": x, \"name\": \"bob\"},\n           {\"db_id\": y, \"name\": \"charlie\"},\n       ]\n       assert x != y\n       assert x < y\n\n\nInstallation\n------------\n.. code-block:: bash\n   :class: ignore\n\n   pip install pyariable\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Placeholder variables to aid in testing.",
    "version": "0.7.0",
    "project_urls": {
        "Homepage": "https://github.com/willemt/pyariable",
        "Repository": "https://github.com/willemt/pyariable"
    },
    "split_keywords": [
        "testing",
        " development"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e41e8278799ed0faefb5e606aaf9b8105c4947262d6bd80d255a68270d53f4d1",
                "md5": "c3689c77cfae007eb2be7c83ad3f52e4",
                "sha256": "fd332596bd4c45c7d575cfe618668b7af1e808d6d6ff4121d24b155dbedc9d73"
            },
            "downloads": -1,
            "filename": "pyariable-0.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c3689c77cfae007eb2be7c83ad3f52e4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 2314,
            "upload_time": "2024-12-04T02:25:44",
            "upload_time_iso_8601": "2024-12-04T02:25:44.248391Z",
            "url": "https://files.pythonhosted.org/packages/e4/1e/8278799ed0faefb5e606aaf9b8105c4947262d6bd80d255a68270d53f4d1/pyariable-0.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "62a2c395618c9110a4b61e3f1db9ba69a4f274237f29fbd7683d00f3ee6e4ca9",
                "md5": "9e4ce54f26e03e39ad01dacb6a4c7f7e",
                "sha256": "a310d65d133d4e054373613d696086bbf8ef5d6ac68393b26641dd1814976a74"
            },
            "downloads": -1,
            "filename": "pyariable-0.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9e4ce54f26e03e39ad01dacb6a4c7f7e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 1913,
            "upload_time": "2024-12-04T02:25:46",
            "upload_time_iso_8601": "2024-12-04T02:25:46.924432Z",
            "url": "https://files.pythonhosted.org/packages/62/a2/c395618c9110a4b61e3f1db9ba69a4f274237f29fbd7683d00f3ee6e4ca9/pyariable-0.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-04 02:25:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "willemt",
    "github_project": "pyariable",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyariable"
}
        
Elapsed time: 0.40088s