ivoire


Nameivoire JSON
Version 0.4.0 PyPI version JSON
download
home_page
SummaryA simple RSpec-like testing framework.
upload_time2023-12-29 14:13:36
maintainer
docs_urlNone
authorJulian Berman
requires_python>=3.8
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ======
Ivoire
======

|PyPI| |Pythons| |CI| |Codecov|

``ivoire`` is an `RSpec <http://rspec.info/>`_-like testing framework for
Python. It aims to bring a few minor constructs over to Python in a way that
isn't overwhelmingly disruptive or counterculture.

In case you've never heard of RSpec, it's a Ruby
`BDD <http://en.wikipedia.org/wiki/Behavior_driven_development>`_ framework
that is fairly widely used, and whose tests have a style unique from xUnit's.

.. |PyPI| image:: https://img.shields.io/pypi/v/Ivoire.svg
  :alt: PyPI version
  :target: https://pypi.org/project/Ivoire/

.. |Pythons| image:: https://img.shields.io/pypi/pyversions/Ivoire.svg
  :alt: Supported Python versions
  :target: https://pypi.org/project/Ivoire/

.. |CI| image:: https://github.com/Julian/Ivoire/workflows/CI/badge.svg
  :alt: Build status
  :target: https://github.com/Julian/Ivoire/actions?query=workflow%3ACI

.. |Codecov| image:: https://codecov.io/gh/Julian/Ivoire/branch/master/graph/badge.svg
  :alt: Codecov Code coverage
  :target: https://codecov.io/gh/Julian/Ivoire


Installation
------------

Ivoire is on `PyPI <http://pypi.python.org/pypi/ivoire>`_ and can be installed
via ``pip install ivoire`` (or via your preferred installation method).

At this point you should consider Ivoire to be experimental, and there are
likely plenty of bugs to address, so please file them as you run into them on
the `issue tracker <https://github.com/Julian/Ivoire/issues>`_.


A Small Example
---------------

To write specs using Ivoire, simply import and use ``ivoire.describe``. You can
then execute the spec using the included ``ivoire`` test runner.

Here's an example of what a specification looks like.

.. code:: python

    from ivoire import describe, context


    class Calculator(object):
        def add(self, x, y):
            return x + y

        def divide(self, x, y):
            return x / y


    with describe(Calculator) as it:
        @it.before
        def before(test):
            test.calc = Calculator()

        with it("adds two numbers") as test:
            test.assertEqual(test.calc.add(2, 4), 6)

        with it("multiplies two numbers") as test:
            test.assertEqual(test.calc.multiply(2, 3), 6)

        with context(Calculator.divide):
            with it("divides two numbers") as test:
                test.assertEqual(test.calc.divide(8, 4), 2)

            with it("doesn't divide by zero") as test:
                with test.assertRaises(ZeroDivisionError):
                    test.calc.divide(8, 0)


You can find this example at ``examples/calculator_spec.py``, alongside a few
others.

After installing Ivoire, running the example above with
``ivoire examples/calculator_spec.py`` should produce:

.. image:: https://github.com/Julian/Ivoire/raw/master/examples/img/calculator_spec_output.png
    :alt: spec output
    :align: center

If you'd like a more verbose output, try passing the ``-v`` command line flag.

At some point in the (hopefully very near) future, when I've sorted out an
import hook, Ivoire will also be able to be run as
``ivoire transform `which nosetests` --testmatch='(?:^|[\b_\./-])[Ss]pec'``,
which will transform specs automatically into normal ``unittest.TestCase``\s.
Work on this is in progress.


Running the Test Suite
----------------------

Ivoire's test suite is currently written mostly in itself, but it still has a
small section that is written using the standard ``unittest`` test cases.

You can run Ivoire's test suite by running ``tox`` in the root of the
repository checkout after installing ``tox`` via your package manager or with
``pip install tox``. This will run both parts of the suite.


Contributing
------------

I'm Julian Berman.

You can find me on Freenode in ``#python-testing`` and various other channels
(nick: ``tos9``) if you'd like to chat.

Ivoire is developed on `GitHub <http://github.com/Julian/Ivoire>`_.

Feel free to fork and submit patches or feature requests. Your contributions
are most welcome!

If you'd like the best chance for them to be merged quickly try to include
tests with your pull request, and adhere to general Python coding standards and
your own common sense :).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ivoire",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Julian Berman",
    "author_email": "Julian+Ivoire@GrayVines.com",
    "download_url": "https://files.pythonhosted.org/packages/ba/df/69f0c63af63511b4e23705d83d8880828ac5951e81c934aae39c3d113d75/ivoire-0.4.0.tar.gz",
    "platform": null,
    "description": "======\nIvoire\n======\n\n|PyPI| |Pythons| |CI| |Codecov|\n\n``ivoire`` is an `RSpec <http://rspec.info/>`_-like testing framework for\nPython. It aims to bring a few minor constructs over to Python in a way that\nisn't overwhelmingly disruptive or counterculture.\n\nIn case you've never heard of RSpec, it's a Ruby\n`BDD <http://en.wikipedia.org/wiki/Behavior_driven_development>`_ framework\nthat is fairly widely used, and whose tests have a style unique from xUnit's.\n\n.. |PyPI| image:: https://img.shields.io/pypi/v/Ivoire.svg\n  :alt: PyPI version\n  :target: https://pypi.org/project/Ivoire/\n\n.. |Pythons| image:: https://img.shields.io/pypi/pyversions/Ivoire.svg\n  :alt: Supported Python versions\n  :target: https://pypi.org/project/Ivoire/\n\n.. |CI| image:: https://github.com/Julian/Ivoire/workflows/CI/badge.svg\n  :alt: Build status\n  :target: https://github.com/Julian/Ivoire/actions?query=workflow%3ACI\n\n.. |Codecov| image:: https://codecov.io/gh/Julian/Ivoire/branch/master/graph/badge.svg\n  :alt: Codecov Code coverage\n  :target: https://codecov.io/gh/Julian/Ivoire\n\n\nInstallation\n------------\n\nIvoire is on `PyPI <http://pypi.python.org/pypi/ivoire>`_ and can be installed\nvia ``pip install ivoire`` (or via your preferred installation method).\n\nAt this point you should consider Ivoire to be experimental, and there are\nlikely plenty of bugs to address, so please file them as you run into them on\nthe `issue tracker <https://github.com/Julian/Ivoire/issues>`_.\n\n\nA Small Example\n---------------\n\nTo write specs using Ivoire, simply import and use ``ivoire.describe``. You can\nthen execute the spec using the included ``ivoire`` test runner.\n\nHere's an example of what a specification looks like.\n\n.. code:: python\n\n    from ivoire import describe, context\n\n\n    class Calculator(object):\n        def add(self, x, y):\n            return x + y\n\n        def divide(self, x, y):\n            return x / y\n\n\n    with describe(Calculator) as it:\n        @it.before\n        def before(test):\n            test.calc = Calculator()\n\n        with it(\"adds two numbers\") as test:\n            test.assertEqual(test.calc.add(2, 4), 6)\n\n        with it(\"multiplies two numbers\") as test:\n            test.assertEqual(test.calc.multiply(2, 3), 6)\n\n        with context(Calculator.divide):\n            with it(\"divides two numbers\") as test:\n                test.assertEqual(test.calc.divide(8, 4), 2)\n\n            with it(\"doesn't divide by zero\") as test:\n                with test.assertRaises(ZeroDivisionError):\n                    test.calc.divide(8, 0)\n\n\nYou can find this example at ``examples/calculator_spec.py``, alongside a few\nothers.\n\nAfter installing Ivoire, running the example above with\n``ivoire examples/calculator_spec.py`` should produce:\n\n.. image:: https://github.com/Julian/Ivoire/raw/master/examples/img/calculator_spec_output.png\n    :alt: spec output\n    :align: center\n\nIf you'd like a more verbose output, try passing the ``-v`` command line flag.\n\nAt some point in the (hopefully very near) future, when I've sorted out an\nimport hook, Ivoire will also be able to be run as\n``ivoire transform `which nosetests` --testmatch='(?:^|[\\b_\\./-])[Ss]pec'``,\nwhich will transform specs automatically into normal ``unittest.TestCase``\\s.\nWork on this is in progress.\n\n\nRunning the Test Suite\n----------------------\n\nIvoire's test suite is currently written mostly in itself, but it still has a\nsmall section that is written using the standard ``unittest`` test cases.\n\nYou can run Ivoire's test suite by running ``tox`` in the root of the\nrepository checkout after installing ``tox`` via your package manager or with\n``pip install tox``. This will run both parts of the suite.\n\n\nContributing\n------------\n\nI'm Julian Berman.\n\nYou can find me on Freenode in ``#python-testing`` and various other channels\n(nick: ``tos9``) if you'd like to chat.\n\nIvoire is developed on `GitHub <http://github.com/Julian/Ivoire>`_.\n\nFeel free to fork and submit patches or feature requests. Your contributions\nare most welcome!\n\nIf you'd like the best chance for them to be merged quickly try to include\ntests with your pull request, and adhere to general Python coding standards and\nyour own common sense :).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A simple RSpec-like testing framework.",
    "version": "0.4.0",
    "project_urls": {
        "Funding": "https://github.com/sponsors/Julian",
        "Homepage": "https://github.com/Julian/Ivoire",
        "Issues": "https://github.com/Julian/Ivoire/issues/",
        "Source": "https://github.com/Julian/Ivoire"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70ee7434f10d535f3c8c163ad6a1bb7b3c4e38b52fdb15d204ad26c3d2cdab24",
                "md5": "33a13caff86f6f23295e6aa66a1da728",
                "sha256": "b34cabcefcc50b7ae36567a4e23a2a4cd05b42110f0649c97f6ae690d699ec98"
            },
            "downloads": -1,
            "filename": "ivoire-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "33a13caff86f6f23295e6aa66a1da728",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 24987,
            "upload_time": "2023-12-29T14:13:34",
            "upload_time_iso_8601": "2023-12-29T14:13:34.918070Z",
            "url": "https://files.pythonhosted.org/packages/70/ee/7434f10d535f3c8c163ad6a1bb7b3c4e38b52fdb15d204ad26c3d2cdab24/ivoire-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "badf69f0c63af63511b4e23705d83d8880828ac5951e81c934aae39c3d113d75",
                "md5": "96b941774bd078fdc90e406677d22dc6",
                "sha256": "88d516595d2740a8f53b1bfed9ff27cce2d59b30f575d1f0a0f5e0801e8c8ff9"
            },
            "downloads": -1,
            "filename": "ivoire-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "96b941774bd078fdc90e406677d22dc6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 50103,
            "upload_time": "2023-12-29T14:13:36",
            "upload_time_iso_8601": "2023-12-29T14:13:36.755766Z",
            "url": "https://files.pythonhosted.org/packages/ba/df/69f0c63af63511b4e23705d83d8880828ac5951e81c934aae39c3d113d75/ivoire-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-29 14:13:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sponsors",
    "github_project": "Julian",
    "github_not_found": true,
    "lcname": "ivoire"
}
        
Elapsed time: 0.20180s