Skip to main content

A pytest plugin to run Xvfb for tests.

Project description

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.

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

You can also 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-xvfb-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file pytest-xvfb-0.1.0.tar.gz.

File metadata

  • Download URL: pytest-xvfb-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pytest-xvfb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aafe5136813b92fed05f0878914ab9245c9d70f6d48d011ab772910879878f30
MD5 92a0435a04b6b0e163a9445083601b3e
BLAKE2b-256 aea948329a16374c1936969c8bef59e5882171147e3ee86f16f7465381e6743d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page