Skip to main content

pytest-xvfb

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

This plugin runs your testsuite with Xvfb to avoid popping up windows during GUI tests or allow them to run on systems without a display (like a CI).

If Xvfb is not installed, it does nothing so your tests will still work.

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 0.2.1

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 0.2.1
File Size Uploaded Provenance Actions
pytest-xvfb-0.2.1.tar.gz 4.1 kB Without provenance Details for pytest-xvfb-0.2.1.tar.gz

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

Download URL pytest-xvfb-0.2.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0cb80f33fef009eefc5db66a26e2a9f5ccdb4d70d04091604edb78815debcb4c
BLAKE2b-256 checksum
How to use checksums
ce8ce00dd5bd53898250c9289d571c44f673653e926428b2b267610031fd1c7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pytest-xvfb 0.2.1

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