summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2017-07-06 07:09:44 +0100
committerSean Whitton <spwhitton@spwhitton.name>2017-07-06 07:09:44 +0100
commitb0c0ec39f7a0175cc5a5f7299bb6db8e1086a84f (patch)
treed84ef782fbcd5ef8dc149d15a0e0fb627c72531b
New upstream version 2016.7.10
-rw-r--r--PKG-INFO210
-rw-r--r--README.rst185
-rw-r--r--pytest_helpers_namespace.egg-info/PKG-INFO210
-rw-r--r--pytest_helpers_namespace.egg-info/SOURCES.txt12
-rw-r--r--pytest_helpers_namespace.egg-info/dependency_links.txt1
-rw-r--r--pytest_helpers_namespace.egg-info/entry_points.txt3
-rw-r--r--pytest_helpers_namespace.egg-info/requires.txt1
-rw-r--r--pytest_helpers_namespace.egg-info/top_level.txt1
-rw-r--r--pytest_helpers_namespace/__init__.py1
-rw-r--r--pytest_helpers_namespace/plugin.py87
-rw-r--r--pytest_helpers_namespace/version.py20
-rw-r--r--setup.cfg15
-rw-r--r--setup.py88
13 files changed, 834 insertions, 0 deletions
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..0854329
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,210 @@
+Metadata-Version: 1.1
+Name: pytest-helpers-namespace
+Version: 2016.7.10
+Summary: PyTest Helpers Namespace
+Home-page: https://github.com/saltstack/pytest-helpers-namespace
+Author: Pedro Algarvio
+Author-email: pedro@algarvio.me
+License: Apache Software License 2.0
+Description: Pytest Helpers Namespace
+ ========================
+
+ .. image:: https://travis-ci.org/saltstack/pytest-helpers-namespace.svg?branch=master
+ :target: https://travis-ci.org/saltstack/pytest-helpers-namespace
+ :alt: See Build Status on Travis CI
+
+ .. image:: https://ci.appveyor.com/api/projects/status/github/saltstack/pytest-helpers-namespace?branch=master
+ :target: https://ci.appveyor.com/project/saltstack-public/pytest-helpers-namespace/branch/master
+ :alt: See Build Status on AppVeyor
+
+ .. 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
+
+
+ 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
+
+ pytest_plugins = ['helpers_namespace']
+
+ 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
+
+
+ Contributing
+ ------------
+ Contributions are very welcome. Tests can be run with `tox`_, please ensure
+ the coverage at least stays the same before you submit a pull request.
+
+ License
+ -------
+
+ Distributed under the terms of the `Apache Software License 2.0`_ license,
+ "pytest-helpers-namespace" is free and open source software.
+
+
+ Issues
+ ------
+
+ If you encounter any problems, please `file an issue`_ along with a detailed
+ description.
+
+ Changelog
+ ---------
+
+ v2016.7.10
+ ~~~~~~~~~~
+
+ * Allow a registered function to contibue to behave as a regular function. `#4`_.
+
+ v2016.4.15
+ ~~~~~~~~~~
+
+ * Hide the ``FuncWrapper`` traceback in pytest failures. `#3`_. Thanks Logan Glickfield(`@lsglick`_)
+
+ v2016.4.5
+ ~~~~~~~~~
+
+ * Use a wrapper class instead of adding an attribute to a function.
+
+ v2016.4.3
+ ~~~~~~~~~
+
+ * Provide proper errors when helper functions or namespaces are being
+ overridden. `#1`_
+
+ v2016.3.2
+ ~~~~~~~~~~
+
+ * First working release
+
+ ----
+
+ 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
+ .. _`Apache Software License 2.0`: http://www.apache.org/licenses/LICENSE-2.0
+ .. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin
+ .. _`file an issue`: https://github.com/saltstack/pytest-helpers-namespace/issues
+ .. _`pytest`: https://github.com/pytest-dev/pytest
+ .. _`tox`: https://tox.readthedocs.org/en/latest/
+ .. _`pip`: https://pypi.python.org/pypi/pip/
+ .. _`PyPI`: https://pypi.python.org/pypi
+
+ .. _`#1`: https://github.com/saltstack/pytest-helpers-namespace/issues/1
+ .. _`#3`: https://github.com/saltstack/pytest-helpers-namespace/pull/3
+ .. _`#4`: https://github.com/saltstack/pytest-helpers-namespace/issues/4
+
+ .. _`@lsglick`: https://github.com/lsglick
+
+Platform: UNKNOWN
+Classifier: Development Status :: 4 - Beta
+Classifier: Framework :: Pytest
+Classifier: Intended Audience :: Developers
+Classifier: Topic :: Software Development :: Testing
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
+Classifier: Operating System :: OS Independent
+Classifier: License :: OSI Approved :: Apache Software License
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..3b4ef7c
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,185 @@
+Pytest Helpers Namespace
+========================
+
+.. image:: https://travis-ci.org/saltstack/pytest-helpers-namespace.svg?branch=master
+ :target: https://travis-ci.org/saltstack/pytest-helpers-namespace
+ :alt: See Build Status on Travis CI
+
+.. image:: https://ci.appveyor.com/api/projects/status/github/saltstack/pytest-helpers-namespace?branch=master
+ :target: https://ci.appveyor.com/project/saltstack-public/pytest-helpers-namespace/branch/master
+ :alt: See Build Status on AppVeyor
+
+.. 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
+
+
+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
+
+ pytest_plugins = ['helpers_namespace']
+
+ 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
+
+
+Contributing
+------------
+Contributions are very welcome. Tests can be run with `tox`_, please ensure
+the coverage at least stays the same before you submit a pull request.
+
+License
+-------
+
+Distributed under the terms of the `Apache Software License 2.0`_ license,
+"pytest-helpers-namespace" is free and open source software.
+
+
+Issues
+------
+
+If you encounter any problems, please `file an issue`_ along with a detailed
+description.
+
+Changelog
+---------
+
+v2016.7.10
+~~~~~~~~~~
+
+* Allow a registered function to contibue to behave as a regular function. `#4`_.
+
+v2016.4.15
+~~~~~~~~~~
+
+* Hide the ``FuncWrapper`` traceback in pytest failures. `#3`_. Thanks Logan Glickfield(`@lsglick`_)
+
+v2016.4.5
+~~~~~~~~~
+
+* Use a wrapper class instead of adding an attribute to a function.
+
+v2016.4.3
+~~~~~~~~~
+
+* Provide proper errors when helper functions or namespaces are being
+ overridden. `#1`_
+
+v2016.3.2
+~~~~~~~~~~
+
+* First working release
+
+----
+
+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
+.. _`Apache Software License 2.0`: http://www.apache.org/licenses/LICENSE-2.0
+.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin
+.. _`file an issue`: https://github.com/saltstack/pytest-helpers-namespace/issues
+.. _`pytest`: https://github.com/pytest-dev/pytest
+.. _`tox`: https://tox.readthedocs.org/en/latest/
+.. _`pip`: https://pypi.python.org/pypi/pip/
+.. _`PyPI`: https://pypi.python.org/pypi
+
+.. _`#1`: https://github.com/saltstack/pytest-helpers-namespace/issues/1
+.. _`#3`: https://github.com/saltstack/pytest-helpers-namespace/pull/3
+.. _`#4`: https://github.com/saltstack/pytest-helpers-namespace/issues/4
+
+.. _`@lsglick`: https://github.com/lsglick
diff --git a/pytest_helpers_namespace.egg-info/PKG-INFO b/pytest_helpers_namespace.egg-info/PKG-INFO
new file mode 100644
index 0000000..0854329
--- /dev/null
+++ b/pytest_helpers_namespace.egg-info/PKG-INFO
@@ -0,0 +1,210 @@
+Metadata-Version: 1.1
+Name: pytest-helpers-namespace
+Version: 2016.7.10
+Summary: PyTest Helpers Namespace
+Home-page: https://github.com/saltstack/pytest-helpers-namespace
+Author: Pedro Algarvio
+Author-email: pedro@algarvio.me
+License: Apache Software License 2.0
+Description: Pytest Helpers Namespace
+ ========================
+
+ .. image:: https://travis-ci.org/saltstack/pytest-helpers-namespace.svg?branch=master
+ :target: https://travis-ci.org/saltstack/pytest-helpers-namespace
+ :alt: See Build Status on Travis CI
+
+ .. image:: https://ci.appveyor.com/api/projects/status/github/saltstack/pytest-helpers-namespace?branch=master
+ :target: https://ci.appveyor.com/project/saltstack-public/pytest-helpers-namespace/branch/master
+ :alt: See Build Status on AppVeyor
+
+ .. 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
+
+
+ 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
+
+ pytest_plugins = ['helpers_namespace']
+
+ 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
+
+
+ Contributing
+ ------------
+ Contributions are very welcome. Tests can be run with `tox`_, please ensure
+ the coverage at least stays the same before you submit a pull request.
+
+ License
+ -------
+
+ Distributed under the terms of the `Apache Software License 2.0`_ license,
+ "pytest-helpers-namespace" is free and open source software.
+
+
+ Issues
+ ------
+
+ If you encounter any problems, please `file an issue`_ along with a detailed
+ description.
+
+ Changelog
+ ---------
+
+ v2016.7.10
+ ~~~~~~~~~~
+
+ * Allow a registered function to contibue to behave as a regular function. `#4`_.
+
+ v2016.4.15
+ ~~~~~~~~~~
+
+ * Hide the ``FuncWrapper`` traceback in pytest failures. `#3`_. Thanks Logan Glickfield(`@lsglick`_)
+
+ v2016.4.5
+ ~~~~~~~~~
+
+ * Use a wrapper class instead of adding an attribute to a function.
+
+ v2016.4.3
+ ~~~~~~~~~
+
+ * Provide proper errors when helper functions or namespaces are being
+ overridden. `#1`_
+
+ v2016.3.2
+ ~~~~~~~~~~
+
+ * First working release
+
+ ----
+
+ 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
+ .. _`Apache Software License 2.0`: http://www.apache.org/licenses/LICENSE-2.0
+ .. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin
+ .. _`file an issue`: https://github.com/saltstack/pytest-helpers-namespace/issues
+ .. _`pytest`: https://github.com/pytest-dev/pytest
+ .. _`tox`: https://tox.readthedocs.org/en/latest/
+ .. _`pip`: https://pypi.python.org/pypi/pip/
+ .. _`PyPI`: https://pypi.python.org/pypi
+
+ .. _`#1`: https://github.com/saltstack/pytest-helpers-namespace/issues/1
+ .. _`#3`: https://github.com/saltstack/pytest-helpers-namespace/pull/3
+ .. _`#4`: https://github.com/saltstack/pytest-helpers-namespace/issues/4
+
+ .. _`@lsglick`: https://github.com/lsglick
+
+Platform: UNKNOWN
+Classifier: Development Status :: 4 - Beta
+Classifier: Framework :: Pytest
+Classifier: Intended Audience :: Developers
+Classifier: Topic :: Software Development :: Testing
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
+Classifier: Operating System :: OS Independent
+Classifier: License :: OSI Approved :: Apache Software License
diff --git a/pytest_helpers_namespace.egg-info/SOURCES.txt b/pytest_helpers_namespace.egg-info/SOURCES.txt
new file mode 100644
index 0000000..b00ad89
--- /dev/null
+++ b/pytest_helpers_namespace.egg-info/SOURCES.txt
@@ -0,0 +1,12 @@
+README.rst
+setup.cfg
+setup.py
+pytest_helpers_namespace/__init__.py
+pytest_helpers_namespace/plugin.py
+pytest_helpers_namespace/version.py
+pytest_helpers_namespace.egg-info/PKG-INFO
+pytest_helpers_namespace.egg-info/SOURCES.txt
+pytest_helpers_namespace.egg-info/dependency_links.txt
+pytest_helpers_namespace.egg-info/entry_points.txt
+pytest_helpers_namespace.egg-info/requires.txt
+pytest_helpers_namespace.egg-info/top_level.txt \ No newline at end of file
diff --git a/pytest_helpers_namespace.egg-info/dependency_links.txt b/pytest_helpers_namespace.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/pytest_helpers_namespace.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/pytest_helpers_namespace.egg-info/entry_points.txt b/pytest_helpers_namespace.egg-info/entry_points.txt
new file mode 100644
index 0000000..5a682b5
--- /dev/null
+++ b/pytest_helpers_namespace.egg-info/entry_points.txt
@@ -0,0 +1,3 @@
+[pytest11]
+helpers_namespace = pytest_helpers_namespace.plugin
+
diff --git a/pytest_helpers_namespace.egg-info/requires.txt b/pytest_helpers_namespace.egg-info/requires.txt
new file mode 100644
index 0000000..2975319
--- /dev/null
+++ b/pytest_helpers_namespace.egg-info/requires.txt
@@ -0,0 +1 @@
+pytest>=2.9.1
diff --git a/pytest_helpers_namespace.egg-info/top_level.txt b/pytest_helpers_namespace.egg-info/top_level.txt
new file mode 100644
index 0000000..1a1f9dc
--- /dev/null
+++ b/pytest_helpers_namespace.egg-info/top_level.txt
@@ -0,0 +1 @@
+pytest_helpers_namespace
diff --git a/pytest_helpers_namespace/__init__.py b/pytest_helpers_namespace/__init__.py
new file mode 100644
index 0000000..40a96af
--- /dev/null
+++ b/pytest_helpers_namespace/__init__.py
@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-
diff --git a/pytest_helpers_namespace/plugin.py b/pytest_helpers_namespace/plugin.py
new file mode 100644
index 0000000..729036b
--- /dev/null
+++ b/pytest_helpers_namespace/plugin.py
@@ -0,0 +1,87 @@
+# -*- coding: utf-8 -*-
+'''
+ :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
+ :copyright: © 2016 by the SaltStack Team, see AUTHORS for more details.
+ :license: Apache 2.0, see LICENSE for more details.
+
+
+ pytest_helpers_namespace.plugin
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Pytest Helpers Namespace Plugin
+'''
+
+# Import python libs
+from functools import wraps
+
+class FuncWrapper(object):
+
+ def __init__(self, func):
+ self.func = func
+
+ def register(self, func):
+ '''
+ This function will just raise a RuntimeError in case a function
+ registration, which also sets a nested namespace, tries to override
+ a known helper function with that nested namespace.
+ This will just make the raised error make more sense.
+
+ Instead of "AttributeError: 'function' object has no attribute 'register'",
+ we will raise the excption below.
+ '''
+ raise RuntimeError(
+ 'A namespace is already registered under the name: {0}'.format(
+ func.__name__
+ )
+ )
+
+ def __call__(self, *args, **kwargs):
+ '''
+ This wrapper will just call the actual helper function
+ '''
+ __tracebackhide__ = True
+ return self.func(*args, **kwargs)
+
+
+class HelpersRegistry(object):
+ '''
+ Helper functions registrar which supports namespaces
+ '''
+
+ __slots__ = ('_registry',)
+
+ def __init__(self):
+ self._registry = {}
+
+ def register(self, func):
+ '''
+ Register's a new function as a helper
+ '''
+ if func.__name__ in self._registry:
+ raise RuntimeError(
+ 'A helper function is already registered under the name: {0}'.format(
+ func.__name__
+ )
+ )
+ self._registry[func.__name__] = wraps(func)(FuncWrapper(func))
+ return func
+
+ def __getattribute__(self, name):
+ if name in ('__class__', '_registry', 'register'):
+ return object.__getattribute__(self, name)
+ return self._registry.setdefault(name, self.__class__())
+
+ def __repr__(self):
+ return '{0} {1!r}>'.format(self.__class__.__name__, self._registry)
+
+ def __call__(self, *args, **kwargs):
+ raise RuntimeError(
+ 'The helper being called was not registred'
+ )
+
+
+def pytest_namespace():
+ '''
+ Register our own namespace with pytest
+ '''
+ return {'helpers': HelpersRegistry()}
diff --git a/pytest_helpers_namespace/version.py b/pytest_helpers_namespace/version.py
new file mode 100644
index 0000000..6e9d74b
--- /dev/null
+++ b/pytest_helpers_namespace/version.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+'''
+ :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
+ :copyright: © 2016 by the SaltStack Team, see AUTHORS for more details.
+ :license: Apache 2.0, see LICENSE for more details.
+
+
+ pytest_helpers_namespace.version
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ pytest helpers-namespace plugin version information
+'''
+# pragma: no cover
+
+# Import Python Libs
+from __future__ import absolute_import
+
+
+__version_info__ = (2016, 7, 10)
+__version__ = '{0}.{1}.{2}'.format(*__version_info__)
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..e219d9c
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,15 @@
+[upload]
+sign = true
+identity = 84A298FF
+
+[aliases]
+release = clean register sdist bdist_wheel upload
+
+[bdist_wheel]
+universal = 1
+
+[egg_info]
+tag_build =
+tag_date = 0
+tag_svn_revision = 0
+
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..8279ffd
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,88 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from __future__ import absolute_import, with_statement
+import os
+import sys
+import codecs
+from setuptools import setup, find_packages
+
+
+# Change to source's directory prior to running any command
+try:
+ SETUP_DIRNAME = os.path.dirname(__file__)
+except NameError:
+ # We're most likely being frozen and __file__ triggered this NameError
+ # Let's work around that
+ SETUP_DIRNAME = os.path.dirname(sys.argv[0])
+
+if SETUP_DIRNAME != '':
+ os.chdir(SETUP_DIRNAME)
+
+
+def read(fname):
+ '''
+ Read a file from the directory where setup.py resides
+ '''
+ file_path = os.path.join(SETUP_DIRNAME, fname)
+ with codecs.open(file_path, encoding='utf-8') as rfh:
+ return rfh.read()
+
+
+# Version info -- read without importing
+_LOCALS = {}
+with codecs.open(os.path.join(SETUP_DIRNAME,
+ 'pytest_helpers_namespace',
+ 'version.py'), encoding='utf-8') as rfh:
+ contents = rfh.read()
+ try:
+ exec(contents, None, _LOCALS) # pylint: disable=exec-used
+ except SyntaxError:
+ # SyntaxError: encoding declaration in Unicode string
+ exec(contents.encode('utf-8'), None, _LOCALS) # pylint: disable=exec-used
+
+
+VERSION = _LOCALS['__version__']
+LONG_DESCRIPTION = read('README.rst')
+
+def read(fname):
+ file_path = os.path.join(os.path.dirname(__file__), fname)
+ return codecs.open(file_path, encoding='utf-8').read()
+
+
+setup(
+ name='pytest-helpers-namespace',
+ version=VERSION,
+ author='Pedro Algarvio',
+ author_email='pedro@algarvio.me',
+ maintainer='Pedro Algarvio',
+ maintainer_email='pedro@algarvio.me',
+ license='Apache Software License 2.0',
+ url='https://github.com/saltstack/pytest-helpers-namespace',
+ description='PyTest Helpers Namespace',
+ long_description=LONG_DESCRIPTION,
+ packages=find_packages(),
+ install_requires=['pytest>=2.9.1'],
+ classifiers=[
+ 'Development Status :: 4 - Beta',
+ 'Framework :: Pytest',
+ 'Intended Audience :: Developers',
+ 'Topic :: Software Development :: Testing',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: Implementation :: CPython',
+ 'Programming Language :: Python :: Implementation :: PyPy',
+ 'Operating System :: OS Independent',
+ 'License :: OSI Approved :: Apache Software License',
+ ],
+ entry_points={
+ 'pytest11': [
+ 'helpers_namespace = pytest_helpers_namespace.plugin',
+ ],
+ },
+)