pytest-xvfb


Namepytest-xvfb JSON
Version 3.0.0 PyPI version JSON
download
home_page
SummaryA pytest plugin to run Xvfb (or Xephyr/Xvnc) for tests.
upload_time2023-05-29 11:54:30
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            pytest-xvfb
===================================

A pytest plugin to run `Xvfb`_ (or `Xephyr`_/`Xvnc`_) for tests.

----

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

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

    $ pip install pytest-xvfb


Usage
-----

With Xvfb and the plugin installed, your testsuite automatically runs with `Xvfb`_. This allows tests to be run without windows popping up during GUI tests or on systems without a display (like a CI).

The plugin sees Xvfb being installed as "optional", since the tests can still
run without it installed. If it's unavailable, it will show an informational
message, if on Linux and a ``DISPLAY`` is available. When using
``--xvfb-backend xvfb``, this message will turn into a hard error instead.

If you're currently using ``xvfb-run`` in something like a GitHub Actions YAML
file simply remove the wrapper and install this plugin instead - then you'll
also have the benefits of Xvfb locally.

Features
--------

You can pass ``--no-xvfb`` to explicitly turn off Xvfb (e.g. to visually
inspect a failure).

With ``--xvfb-backend xephyr`` or ``--xvfb-backend xvnc``, you can use Xephyr
or Xvnc in place of Xvfb, e.g. to visually inspect failures.

**NOTE:** Support for ``xvnc`` is currently experimental and not tested on CI,
due to incompatibilities with PyVirtualDisplay and Ubuntu 22.04's tightvncserver.

You can mark tests with ``@pytest.mark.no_xvfb`` to skip them when they're
running with Xvfb.

A ``xvfb`` fixture is available with the following attributes:

- ``width``: The configured width of the screen.
- ``height``: The configured height of the screen.
- ``colordepth``: The configured colordepth of the screen.
- ``args``: The arguments to be passed to Xvfb.
- ``display``: The display number (as int) which is used.
- ``backend``: Either ``None`` (Xvfb), ``"xvfb"``, ``"xephyr"``, or ``"xvnc"``.

In a pytest.ini, ``xvfb_width``, ``xvfb_height``, ``xvfb_colordepth`` and
``xvfb_args`` can be used to configure the respective values. In addition,
``xvfb_xauth`` can be set to ``true`` to generate an ``Xauthority`` token.

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

Thanks
------

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

Thanks to `@cgoldberg`_ for `xvfbwrapper`_ which was the inspiration for this
project.

Issues
------

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

.. _`pytest-xvfb`: https://pypi.python.org/pypi/pytest-xvfb/
.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter
.. _`@hackebrot`: https://github.com/hackebrot
.. _`@cgoldberg`: https://github.com/cgoldberg
.. _`xvfbwrapper`: https://github.com/cgoldberg/xvfbwrapper
.. _`MIT`: http://opensource.org/licenses/MIT
.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin
.. _`file an issue`: https://github.com/The-Compiler/pytest-xvfb/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
.. _`Xvfb`: https://en.wikipedia.org/wiki/Xvfb
.. _`Xephyr`: https://www.freedesktop.org/wiki/Software/Xephyr/
.. _`Xvnc`: https://tigervnc.org/doc/Xvnc.html

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pytest-xvfb",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "Florian Bruhin <me@the-compiler.org>",
    "keywords": "",
    "author": "",
    "author_email": "Florian Bruhin <me@the-compiler.org>",
    "download_url": "https://files.pythonhosted.org/packages/37/3b/323923d97a3a53d8f302b8115e6c58f3606f8d2a376d36fec821351bc678/pytest-xvfb-3.0.0.tar.gz",
    "platform": null,
    "description": "pytest-xvfb\n===================================\n\nA pytest plugin to run `Xvfb`_ (or `Xephyr`_/`Xvnc`_) for tests.\n\n----\n\nInstallation\n------------\n\nYou can install \"`pytest-xvfb`_\" via `pip`_ from `PyPI`_::\n\n    $ pip install pytest-xvfb\n\n\nUsage\n-----\n\nWith Xvfb and the plugin installed, your testsuite automatically runs with `Xvfb`_. This allows tests to be run without windows popping up during GUI tests or on systems without a display (like a CI).\n\nThe plugin sees Xvfb being installed as \"optional\", since the tests can still\nrun without it installed. If it's unavailable, it will show an informational\nmessage, if on Linux and a ``DISPLAY`` is available. When using\n``--xvfb-backend xvfb``, this message will turn into a hard error instead.\n\nIf you're currently using ``xvfb-run`` in something like a GitHub Actions YAML\nfile simply remove the wrapper and install this plugin instead - then you'll\nalso have the benefits of Xvfb locally.\n\nFeatures\n--------\n\nYou can pass ``--no-xvfb`` to explicitly turn off Xvfb (e.g. to visually\ninspect a failure).\n\nWith ``--xvfb-backend xephyr`` or ``--xvfb-backend xvnc``, you can use Xephyr\nor Xvnc in place of Xvfb, e.g. to visually inspect failures.\n\n**NOTE:** Support for ``xvnc`` is currently experimental and not tested on CI,\ndue to incompatibilities with PyVirtualDisplay and Ubuntu 22.04's tightvncserver.\n\nYou can mark tests with ``@pytest.mark.no_xvfb`` to skip them when they're\nrunning with Xvfb.\n\nA ``xvfb`` fixture is available with the following attributes:\n\n- ``width``: The configured width of the screen.\n- ``height``: The configured height of the screen.\n- ``colordepth``: The configured colordepth of the screen.\n- ``args``: The arguments to be passed to Xvfb.\n- ``display``: The display number (as int) which is used.\n- ``backend``: Either ``None`` (Xvfb), ``\"xvfb\"``, ``\"xephyr\"``, or ``\"xvnc\"``.\n\nIn a pytest.ini, ``xvfb_width``, ``xvfb_height``, ``xvfb_colordepth`` and\n``xvfb_args`` can be used to configure the respective values. In addition,\n``xvfb_xauth`` can be set to ``true`` to generate an ``Xauthority`` token.\n\nContributing\n------------\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 `MIT`_ license, \"pytest-xvfb\" is free and open source software\n\nThanks\n------\n\nThis `pytest`_ plugin was generated with `Cookiecutter`_ along with\n`@hackebrot`_'s `Cookiecutter-pytest-plugin`_ template.\n\nThanks to `@cgoldberg`_ for `xvfbwrapper`_ which was the inspiration for this\nproject.\n\nIssues\n------\n\nIf you encounter any problems, please `file an issue`_ along with a detailed description.\n\n.. _`pytest-xvfb`: https://pypi.python.org/pypi/pytest-xvfb/\n.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter\n.. _`@hackebrot`: https://github.com/hackebrot\n.. _`@cgoldberg`: https://github.com/cgoldberg\n.. _`xvfbwrapper`: https://github.com/cgoldberg/xvfbwrapper\n.. _`MIT`: http://opensource.org/licenses/MIT\n.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin\n.. _`file an issue`: https://github.com/The-Compiler/pytest-xvfb/issues\n.. _`pytest`: https://github.com/pytest-dev/pytest\n.. _`tox`: https://tox.readthedocs.org/en/latest/\n.. _`pip`: https://pypi.python.org/pypi/pip/\n.. _`PyPI`: https://pypi.python.org/pypi\n.. _`Xvfb`: https://en.wikipedia.org/wiki/Xvfb\n.. _`Xephyr`: https://www.freedesktop.org/wiki/Software/Xephyr/\n.. _`Xvnc`: https://tigervnc.org/doc/Xvnc.html\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A pytest plugin to run Xvfb (or Xephyr/Xvnc) for tests.",
    "version": "3.0.0",
    "project_urls": {
        "Homepage": "https://github.com/The-Compiler/pytest-xvfb"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8695d1f71d55425daa5f7f534b58ad15efbe1969ad67894033df58dd285eed62",
                "md5": "df4c4b903911326616acbde8721bb1d5",
                "sha256": "352f247c788457ccdfcfeec8a47a2a6594c8eaf22f0302dae9e2635bb23975c2"
            },
            "downloads": -1,
            "filename": "pytest_xvfb-3.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "df4c4b903911326616acbde8721bb1d5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 5645,
            "upload_time": "2023-05-29T11:54:28",
            "upload_time_iso_8601": "2023-05-29T11:54:28.932382Z",
            "url": "https://files.pythonhosted.org/packages/86/95/d1f71d55425daa5f7f534b58ad15efbe1969ad67894033df58dd285eed62/pytest_xvfb-3.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "373b323923d97a3a53d8f302b8115e6c58f3606f8d2a376d36fec821351bc678",
                "md5": "cd099c0154e395dc9a48bede2061e90e",
                "sha256": "3746ab1f4d1159f03f751638d053689ccd284291b38b8fb03d3ebbe7bf69cfc0"
            },
            "downloads": -1,
            "filename": "pytest-xvfb-3.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cd099c0154e395dc9a48bede2061e90e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 8607,
            "upload_time": "2023-05-29T11:54:30",
            "upload_time_iso_8601": "2023-05-29T11:54:30.552623Z",
            "url": "https://files.pythonhosted.org/packages/37/3b/323923d97a3a53d8f302b8115e6c58f3606f8d2a376d36fec821351bc678/pytest-xvfb-3.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-29 11:54:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "The-Compiler",
    "github_project": "pytest-xvfb",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "pytest-xvfb"
}
        
Elapsed time: 0.08201s