Metadata-Version: 2.1
Name: pyariable
Version: 0.9.0
Summary: Placeholder variables to aid in testing.
Home-page: https://github.com/willemt/pyariable
License: BSD-3-Clause
Keywords: testing,development
Author: Willem Thiart
Author-email: himself@willemthiart.com
Requires-Python: >=3.9,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: System :: Logging
Project-URL: Repository, https://github.com/willemt/pyariable
Description-Content-Type: text/x-rst

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

