Skip to main content
See Build Status on Travis CI See Build Status on AppVeyor

A pytest plugin to run Xvfb 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).

If Xvfb is not installed, the plugin does not run and your tests will still work as normal. However, a warning message will print to standard output letting you know that Xvfb is not installed.

If you’re currently using xvfb-run in something like .travis.yml, simply remove it 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).

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.

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.

Metadata

Release files for pytest-xvfb 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-xvfb 2.0.0
File Size Uploaded Provenance Actions
pytest-xvfb-2.0.0.tar.gz 6.6 kB Without provenance Details for pytest-xvfb-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytest-xvfb 2.0.0
File Interpreter ABI Platform Actions
pytest_xvfb-2.0.0-py3-none-any.whl Python 3 none any Details for pytest_xvfb-2.0.0-py3-none-any.whl

Total release size: 11.6 kB

Release files / pytest-xvfb-2.0.0.tar.gz

Download URL pytest-xvfb-2.0.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c4ba642de05499940db7f65ee111621939be513e3e75c3da9156b7235e2ed8cf
BLAKE2b-256 checksum
How to use checksums
07a578bbf89d95bdcf9c391c9ccab136fada0ad9bb8d5b8f467bbab7c4b5217e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

Release files / pytest_xvfb-2.0.0-py3-none-any.whl

Download URL pytest_xvfb-2.0.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d21b46f099c06d6b8b200e73341da3adb73d67e9139c55d617930881779360b
BLAKE2b-256 checksum
How to use checksums
cd7dee4c502197eed1bb549f7f805190df6b37f3fb7a3e918acb734adde3c643
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

Security for pytest-xvfb 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page