pytest-helpers-namespace


Namepytest-helpers-namespace JSON
Version 2021.12.29 PyPI version JSON
download
home_pagehttps://github.com/saltstack/pytest-helpers-namespace
SummaryPytest Helpers Namespace Plugin
upload_time2021-12-29 22:00:37
maintainer
docs_urlNone
authorPedro Algarvio
requires_python>=3.5.6
licenseApache Software License 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            .. image:: https://github.com/saltstack/pytest-helpers-namespace/actions/workflows/testing.yml/badge.svg
    :target: https://github.com/saltstack/pytest-helpers-namespace/actions/workflows/testing.yml
    :alt: See Build Status

.. image:: https://codecov.io/github/saltstack/pytest-helpers-namespace/coverage.svg?branch=master
    :target: https://codecov.io/github/saltstack/pytest-helpers-namespace?branch=master
    :alt: Code Coverage

.. image:: https://img.shields.io/pypi/v/pytest-helpers-namespace.svg?style=flat
    :alt: PyPI Package latest release
    :target: https://pypi.python.org/pypi/pytest-helpers-namespace

.. image:: https://img.shields.io/pypi/dm/pytest-helpers-namespace.svg?style=flat
    :alt: PyPI Package monthly downloads
    :target: https://pypi.python.org/pypi/pytest-helpers-namespace

.. image:: https://img.shields.io/pypi/wheel/pytest-helpers-namespace.svg?style=flat
    :alt: PyPI Wheel
    :target: https://pypi.python.org/pypi/pytest-helpers-namespace

.. image:: https://img.shields.io/pypi/pyversions/pytest-helpers-namespace.svg?style=flat
    :alt: Supported versions
    :target: https://pypi.python.org/pypi/pytest-helpers-namespace

.. image:: https://img.shields.io/pypi/implementation/pytest-helpers-namespace.svg?style=flat
    :alt: Supported implementations
    :target: https://pypi.python.org/pypi/pytest-helpers-namespace

..
   include-starts-here


Pytest Helpers Namespace
========================

This plugin does not provide any helpers to `pytest`_, it does, however,
provide a helpers namespace in `pytest`_ which enables you to register helper
functions in your ``conftest.py`` to be used within your tests without having
to import them.


Features
--------

* Provides a ``helpers`` `pytest`_ namespace which can be used to register
  helper functions without requiring you to import them on your actual tests to
  use them.


Requirements
------------

* None!


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

You can install "pytest-helpers-namespace" via `pip`_ from `PyPI`_::

    $ pip install pytest-helpers-namespace


Usage
-----

Consider the following ``conftest.py`` file:

.. code-block:: python

   import pytest


   @pytest.helpers.register
   def foo(bar):
       """
       this dumb helper function will just return what you pass to it
       """
       return bar


And now consider the following test case:

.. code-block:: python

   def test_helper_namespace():
       assert pytest.helpers.foo(True) is True


Pretty simple right?!


You can even nest namespaces. Consider the following ``conftest.py`` file:

.. code-block:: python

   pytest_plugins = ["helpers_namespace"]

   import pytest


   @pytest.helpers.can.haz.register
   def foo(bar):
       """
       this dumb helper function will just return what you pass to it
       """
       return bar


And now consider the following test case:

.. code-block:: python

   def test_helper_namespace():
       assert pytest.helpers.can.haz.foo(True) is True


You can even pass a name to the register function and that will be the helper function name.


----

This `Pytest`_ plugin was generated with `Cookiecutter`_ along with
`@hackebrot`_'s `Cookiecutter-pytest-plugin`_ template.

.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter
.. _`@hackebrot`: https://github.com/hackebrot
.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin
.. _`pytest`: https://github.com/pytest-dev/pytest
.. _`pip`: https://pypi.python.org/pypi/pip/
.. _`PyPI`: https://pypi.python.org/pypi

..
   include-ends-here

Documentation
=============

The full documentation can be seen `here <https://pytest-helpers-namespace.readthedocs.io>`_.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/saltstack/pytest-helpers-namespace",
    "name": "pytest-helpers-namespace",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Pedro Algarvio",
    "author_email": "pedro@algarvio.me",
    "download_url": "https://files.pythonhosted.org/packages/e8/61/7f1a476b375c1238d152c164f7ffb694c662da8247816947be84b5fe2e8a/pytest-helpers-namespace-2021.12.29.tar.gz",
    "platform": "unix",
    "description": ".. image:: https://github.com/saltstack/pytest-helpers-namespace/actions/workflows/testing.yml/badge.svg\n    :target: https://github.com/saltstack/pytest-helpers-namespace/actions/workflows/testing.yml\n    :alt: See Build Status\n\n.. image:: https://codecov.io/github/saltstack/pytest-helpers-namespace/coverage.svg?branch=master\n    :target: https://codecov.io/github/saltstack/pytest-helpers-namespace?branch=master\n    :alt: Code Coverage\n\n.. image:: https://img.shields.io/pypi/v/pytest-helpers-namespace.svg?style=flat\n    :alt: PyPI Package latest release\n    :target: https://pypi.python.org/pypi/pytest-helpers-namespace\n\n.. image:: https://img.shields.io/pypi/dm/pytest-helpers-namespace.svg?style=flat\n    :alt: PyPI Package monthly downloads\n    :target: https://pypi.python.org/pypi/pytest-helpers-namespace\n\n.. image:: https://img.shields.io/pypi/wheel/pytest-helpers-namespace.svg?style=flat\n    :alt: PyPI Wheel\n    :target: https://pypi.python.org/pypi/pytest-helpers-namespace\n\n.. image:: https://img.shields.io/pypi/pyversions/pytest-helpers-namespace.svg?style=flat\n    :alt: Supported versions\n    :target: https://pypi.python.org/pypi/pytest-helpers-namespace\n\n.. image:: https://img.shields.io/pypi/implementation/pytest-helpers-namespace.svg?style=flat\n    :alt: Supported implementations\n    :target: https://pypi.python.org/pypi/pytest-helpers-namespace\n\n..\n   include-starts-here\n\n\nPytest Helpers Namespace\n========================\n\nThis plugin does not provide any helpers to `pytest`_, it does, however,\nprovide a helpers namespace in `pytest`_ which enables you to register helper\nfunctions in your ``conftest.py`` to be used within your tests without having\nto import them.\n\n\nFeatures\n--------\n\n* Provides a ``helpers`` `pytest`_ namespace which can be used to register\n  helper functions without requiring you to import them on your actual tests to\n  use them.\n\n\nRequirements\n------------\n\n* None!\n\n\nInstallation\n------------\n\nYou can install \"pytest-helpers-namespace\" via `pip`_ from `PyPI`_::\n\n    $ pip install pytest-helpers-namespace\n\n\nUsage\n-----\n\nConsider the following ``conftest.py`` file:\n\n.. code-block:: python\n\n   import pytest\n\n\n   @pytest.helpers.register\n   def foo(bar):\n       \"\"\"\n       this dumb helper function will just return what you pass to it\n       \"\"\"\n       return bar\n\n\nAnd now consider the following test case:\n\n.. code-block:: python\n\n   def test_helper_namespace():\n       assert pytest.helpers.foo(True) is True\n\n\nPretty simple right?!\n\n\nYou can even nest namespaces. Consider the following ``conftest.py`` file:\n\n.. code-block:: python\n\n   pytest_plugins = [\"helpers_namespace\"]\n\n   import pytest\n\n\n   @pytest.helpers.can.haz.register\n   def foo(bar):\n       \"\"\"\n       this dumb helper function will just return what you pass to it\n       \"\"\"\n       return bar\n\n\nAnd now consider the following test case:\n\n.. code-block:: python\n\n   def test_helper_namespace():\n       assert pytest.helpers.can.haz.foo(True) is True\n\n\nYou can even pass a name to the register function and that will be the helper function name.\n\n\n----\n\nThis `Pytest`_ plugin was generated with `Cookiecutter`_ along with\n`@hackebrot`_'s `Cookiecutter-pytest-plugin`_ template.\n\n.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter\n.. _`@hackebrot`: https://github.com/hackebrot\n.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin\n.. _`pytest`: https://github.com/pytest-dev/pytest\n.. _`pip`: https://pypi.python.org/pypi/pip/\n.. _`PyPI`: https://pypi.python.org/pypi\n\n..\n   include-ends-here\n\nDocumentation\n=============\n\nThe full documentation can be seen `here <https://pytest-helpers-namespace.readthedocs.io>`_.\n\n\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "Pytest Helpers Namespace Plugin",
    "version": "2021.12.29",
    "project_urls": {
        "Documentation": "https://pytest-helpers-namespace.readthedocs.io",
        "Homepage": "https://github.com/saltstack/pytest-helpers-namespace",
        "Source": "https://github.com/saltstack/pytest-helpers-namespace",
        "Tracker": "https://github.com/saltstack/pytest-helpers-namespace/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "63a734844a563c425962658f093b359636deefd19eab6783896e0d378dae88a1",
                "md5": "669b3ffba64d82e986b86e1550a6ebf0",
                "sha256": "d5c0262642998437a73d85cb6ae0db57d574facc551c4a4695e92ec50469eb98"
            },
            "downloads": -1,
            "filename": "pytest_helpers_namespace-2021.12.29-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "669b3ffba64d82e986b86e1550a6ebf0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5.6",
            "size": 10501,
            "upload_time": "2021-12-29T22:00:35",
            "upload_time_iso_8601": "2021-12-29T22:00:35.614125Z",
            "url": "https://files.pythonhosted.org/packages/63/a7/34844a563c425962658f093b359636deefd19eab6783896e0d378dae88a1/pytest_helpers_namespace-2021.12.29-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8617f1a476b375c1238d152c164f7ffb694c662da8247816947be84b5fe2e8a",
                "md5": "8c12522bb08cdb9151f6e39d309d9483",
                "sha256": "792038247e0021beb966a7ea6e3a70ff5fcfba77eb72c6ec8fd6287af871c35b"
            },
            "downloads": -1,
            "filename": "pytest-helpers-namespace-2021.12.29.tar.gz",
            "has_sig": false,
            "md5_digest": "8c12522bb08cdb9151f6e39d309d9483",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5.6",
            "size": 53355,
            "upload_time": "2021-12-29T22:00:37",
            "upload_time_iso_8601": "2021-12-29T22:00:37.270326Z",
            "url": "https://files.pythonhosted.org/packages/e8/61/7f1a476b375c1238d152c164f7ffb694c662da8247816947be84b5fe2e8a/pytest-helpers-namespace-2021.12.29.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-12-29 22:00:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "saltstack",
    "github_project": "pytest-helpers-namespace",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "pytest-helpers-namespace"
}
        
Elapsed time: 0.37772s