pytest-libiio


Namepytest-libiio JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/tfcollins/pytest-libiio
SummaryA pytest plugin to manage interfacing with libiio contexts
upload_time2021-01-09 03:25:36
maintainerTravis F. Collins
docs_urlNone
authorTravis F. Collins
requires_python>=3.5
licenseBSD-3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =============
pytest-libiio
=============

.. image:: https://img.shields.io/pypi/v/pytest-libiio.svg
    :target: https://pypi.org/project/pytest-libiio
    :alt: PyPI version

.. image:: https://img.shields.io/pypi/pyversions/pytest-libiio.svg
    :target: https://pypi.org/project/pytest-libiio
    :alt: Python versions

.. image:: https://travis-ci.org/tfcollins/pytest-libiio.svg?branch=master
    :target: https://travis-ci.org/tfcollins/pytest-libiio
    :alt: See Build Status on Travis CI

.. image:: https://coveralls.io/repos/github/tfcollins/pytest-libiio/badge.svg?branch=master
    :target: https://coveralls.io/github/tfcollins/pytest-libiio?branch=master
    :alt: See Coverage Status on Coveralls

.. image:: https://readthedocs.org/projects/pytest-libiio/badge/?version=latest
    :target: https://pytest-libiio.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

A pytest plugin to manage interfacing with libiio contexts

----

pytest-libiio is pytest plugin to manage interfacing with libiio contexts. This plugin is handy for leveraging the (new) zeroconf features of libiio to find, filter, and map libiio contexts to tests. It was created for `pyadi-iio <https://pypi.org/project/pyadi-iio/>`_ testing but is used in other applications that need an organized way to handle libiio contexts without hardcoding URIs or lots of boilerplate code.


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

* libiio and pylibiio
* pytest
* pyyaml

For development the following are also needed:

* tox
* pytest-mock
* pre-commit
* isort
* flake8
* codespell
* black


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

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

    $ pip install pytest-libiio


Usage
-----

This plugin is used to make the access of libiio contexts easier and to provide a unified API through fixtures.

Accessing contexts
^^^^^^^^^^^^^^^^^^

Get list of context descriptions of all found contained

.. code-block:: python

  import pytest
  import iio


  def test_libiio_device(context_desc):
      hardware = ["pluto", "adrv9361", "fmcomms2"]
      for ctx_desc in context_desc:
          if ctx_desc["hw"] in hardware:
              ctx = iio.Context(ctx_desc["uri"])
      if not ctx:
          pytest.skip("No required hardware found")

Require certain hardware through marks

.. code-block:: python

  import pytest
  import iio


  @pytest.mark.iio_hardware("adrv9361")
  def test_libiio_device(context_desc):
      for ctx_desc in context_desc:
          ctx = iio.Context(ctx_desc["uri"])
          ...

Future ideas
------------
Mock testing is common with libiio's python library since hardware is needed otherwise. In future releases we hope to extend features in pytest-mock through this plugin to make mocking libiio more streamlined.

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 `BSD-3`_ license, "pytest-libiio" is free and open source software


Issues
------

If you encounter any problems, please `file an issue`_ along with a detailed description.

.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter
.. _`@hackebrot`: https://github.com/hackebrot
.. _`MIT`: http://opensource.org/licenses/MIT
.. _`BSD-3`: http://opensource.org/licenses/BSD-3-Clause
.. _`GNU GPL v3.0`: http://www.gnu.org/licenses/gpl-3.0.txt
.. _`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/tfcollins/pytest-libiio/issues
.. _`pytest`: https://github.com/pytest-dev/pytest
.. _`tox`: https://tox.readthedocs.io/en/latest/
.. _`pip`: https://pypi.org/project/pip/
.. _`PyPI`: https://pypi.org/project
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tfcollins/pytest-libiio",
    "name": "pytest-libiio",
    "maintainer": "Travis F. Collins",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "travis.collins@analog.com",
    "keywords": "",
    "author": "Travis F. Collins",
    "author_email": "travis.collins@analog.com",
    "download_url": "https://files.pythonhosted.org/packages/62/66/b8d9f2762146dc3698fc0b192115a8b33193a6799f1f490621938f94fdce/pytest-libiio-0.0.3.tar.gz",
    "platform": "",
    "description": "=============\npytest-libiio\n=============\n\n.. image:: https://img.shields.io/pypi/v/pytest-libiio.svg\n    :target: https://pypi.org/project/pytest-libiio\n    :alt: PyPI version\n\n.. image:: https://img.shields.io/pypi/pyversions/pytest-libiio.svg\n    :target: https://pypi.org/project/pytest-libiio\n    :alt: Python versions\n\n.. image:: https://travis-ci.org/tfcollins/pytest-libiio.svg?branch=master\n    :target: https://travis-ci.org/tfcollins/pytest-libiio\n    :alt: See Build Status on Travis CI\n\n.. image:: https://coveralls.io/repos/github/tfcollins/pytest-libiio/badge.svg?branch=master\n    :target: https://coveralls.io/github/tfcollins/pytest-libiio?branch=master\n    :alt: See Coverage Status on Coveralls\n\n.. image:: https://readthedocs.org/projects/pytest-libiio/badge/?version=latest\n    :target: https://pytest-libiio.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\nA pytest plugin to manage interfacing with libiio contexts\n\n----\n\npytest-libiio is pytest plugin to manage interfacing with libiio contexts. This plugin is handy for leveraging the (new) zeroconf features of libiio to find, filter, and map libiio contexts to tests. It was created for `pyadi-iio <https://pypi.org/project/pyadi-iio/>`_ testing but is used in other applications that need an organized way to handle libiio contexts without hardcoding URIs or lots of boilerplate code.\n\n\nRequirements\n------------\n\n* libiio and pylibiio\n* pytest\n* pyyaml\n\nFor development the following are also needed:\n\n* tox\n* pytest-mock\n* pre-commit\n* isort\n* flake8\n* codespell\n* black\n\n\nInstallation\n------------\n\nYou can install \"pytest-libiio\" via `pip`_ from `PyPI`_::\n\n    $ pip install pytest-libiio\n\n\nUsage\n-----\n\nThis plugin is used to make the access of libiio contexts easier and to provide a unified API through fixtures.\n\nAccessing contexts\n^^^^^^^^^^^^^^^^^^\n\nGet list of context descriptions of all found contained\n\n.. code-block:: python\n\n  import pytest\n  import iio\n\n\n  def test_libiio_device(context_desc):\n      hardware = [\"pluto\", \"adrv9361\", \"fmcomms2\"]\n      for ctx_desc in context_desc:\n          if ctx_desc[\"hw\"] in hardware:\n              ctx = iio.Context(ctx_desc[\"uri\"])\n      if not ctx:\n          pytest.skip(\"No required hardware found\")\n\nRequire certain hardware through marks\n\n.. code-block:: python\n\n  import pytest\n  import iio\n\n\n  @pytest.mark.iio_hardware(\"adrv9361\")\n  def test_libiio_device(context_desc):\n      for ctx_desc in context_desc:\n          ctx = iio.Context(ctx_desc[\"uri\"])\n          ...\n\nFuture ideas\n------------\nMock testing is common with libiio's python library since hardware is needed otherwise. In future releases we hope to extend features in pytest-mock through this plugin to make mocking libiio more streamlined.\n\nContributing\n------------\nContributions are very welcome. Tests can be run with `tox`_, please ensure\nthe coverage at least stays the same before you submit a pull request.\n\nLicense\n-------\n\nDistributed under the terms of the `BSD-3`_ license, \"pytest-libiio\" is free and open source software\n\n\nIssues\n------\n\nIf you encounter any problems, please `file an issue`_ along with a detailed description.\n\n.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter\n.. _`@hackebrot`: https://github.com/hackebrot\n.. _`MIT`: http://opensource.org/licenses/MIT\n.. _`BSD-3`: http://opensource.org/licenses/BSD-3-Clause\n.. _`GNU GPL v3.0`: http://www.gnu.org/licenses/gpl-3.0.txt\n.. _`Apache Software License 2.0`: http://www.apache.org/licenses/LICENSE-2.0\n.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin\n.. _`file an issue`: https://github.com/tfcollins/pytest-libiio/issues\n.. _`pytest`: https://github.com/pytest-dev/pytest\n.. _`tox`: https://tox.readthedocs.io/en/latest/\n.. _`pip`: https://pypi.org/project/pip/\n.. _`PyPI`: https://pypi.org/project",
    "bugtrack_url": null,
    "license": "BSD-3",
    "summary": "A pytest plugin to manage interfacing with libiio contexts",
    "version": "0.0.3",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "8957671e84e8e073bea500581041d147",
                "sha256": "772dbcd8b72030a5b8a79e72d21a2c7ca45ca311b19fb35504b556e661e67f90"
            },
            "downloads": -1,
            "filename": "pytest-libiio-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "8957671e84e8e073bea500581041d147",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 6802,
            "upload_time": "2021-01-09T03:25:36",
            "upload_time_iso_8601": "2021-01-09T03:25:36.621608Z",
            "url": "https://files.pythonhosted.org/packages/62/66/b8d9f2762146dc3698fc0b192115a8b33193a6799f1f490621938f94fdce/pytest-libiio-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-01-09 03:25:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "tfcollins",
    "error": "Could not fetch GitHub repository",
    "lcname": "pytest-libiio"
}
        
Elapsed time: 0.17248s